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