feat: reset data based on current interpretation log state
This commit is contained in:
@@ -35,7 +35,7 @@ export const InterpretationLog: React.FC<InterpretationLogProps> = ({ isOpen, se
|
|||||||
|
|
||||||
const { width } = useBrowserDimensionsStore();
|
const { width } = useBrowserDimensionsStore();
|
||||||
const { socket } = useSocketStore();
|
const { socket } = useSocketStore();
|
||||||
const { currentWorkflowActionsState, notify } = useGlobalInfoStore();
|
const { currentWorkflowActionsState, shouldResetInterpretationLog, notify } = useGlobalInfoStore();
|
||||||
|
|
||||||
const toggleDrawer = (newOpen: boolean) => (event: React.KeyboardEvent | React.MouseEvent) => {
|
const toggleDrawer = (newOpen: boolean) => (event: React.KeyboardEvent | React.MouseEvent) => {
|
||||||
if (
|
if (
|
||||||
@@ -94,12 +94,13 @@ export const InterpretationLog: React.FC<InterpretationLogProps> = ({ isOpen, se
|
|||||||
setCustomValue(event.target.value);
|
setCustomValue(event.target.value);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleReset = () => {
|
useEffect(() => {
|
||||||
setLog('');
|
if (shouldResetInterpretationLog) {
|
||||||
setTableData([]);
|
setLog('');
|
||||||
setBinaryData(null);
|
setTableData([]);
|
||||||
notify("success", t('interpretation_log.notifications.reset_success'));
|
setBinaryData(null);
|
||||||
};
|
}
|
||||||
|
}, [shouldResetInterpretationLog]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
socket?.on('log', handleLog);
|
socket?.on('log', handleLog);
|
||||||
|
|||||||
Reference in New Issue
Block a user