monitoring status change refactor
This commit is contained in:
@@ -48,11 +48,11 @@ export function MonitoringDropDown({ file }: {
|
|||||||
};
|
};
|
||||||
}, [dropdownRef, setIsOpen, isOpen]);
|
}, [dropdownRef, setIsOpen, isOpen]);
|
||||||
|
|
||||||
useEffect(() => {
|
/* useEffect(() => {
|
||||||
if (file.monitoring) {
|
if (file.monitoring) {
|
||||||
setCurrentMonitoringStatus(file.monitoring ? file.monitoring : 'NONE');
|
setCurrentMonitoringStatus(file.monitoring ? file.monitoring : 'NONE');
|
||||||
}
|
}
|
||||||
}, [file.monitoring]);
|
}, [file.monitoring]); */
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (isOpen && buttonRef.current) {
|
if (isOpen && buttonRef.current) {
|
||||||
@@ -73,6 +73,7 @@ export function MonitoringDropDown({ file }: {
|
|||||||
await queryClient.invalidateQueries({ queryKey: ['userFilesData'] });
|
await queryClient.invalidateQueries({ queryKey: ['userFilesData'] });
|
||||||
setIsOpen(false);
|
setIsOpen(false);
|
||||||
toast.success(t('the-file-is monitored', { fileName: file.fileName }));
|
toast.success(t('the-file-is monitored', { fileName: file.fileName }));
|
||||||
|
setCurrentMonitoringStatus(monitoring);
|
||||||
} else {
|
} else {
|
||||||
toast.warning(t('failed-to-establish-monitoring'));
|
toast.warning(t('failed-to-establish-monitoring'));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user