From 7c9769f5b92d24a699fc85ae53cc274abfd3d17f Mon Sep 17 00:00:00 2001 From: James Brunton Date: Fri, 29 Aug 2025 13:28:15 +0100 Subject: [PATCH] Change to Viewer mode when Read tool selected (#4317) # Description of Changes Change it so that when you select the Read tool, the Viewer is automatically selected. --- frontend/src/contexts/ToolWorkflowContext.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/src/contexts/ToolWorkflowContext.tsx b/frontend/src/contexts/ToolWorkflowContext.tsx index 4077bac60..b16261bc9 100644 --- a/frontend/src/contexts/ToolWorkflowContext.tsx +++ b/frontend/src/contexts/ToolWorkflowContext.tsx @@ -138,8 +138,12 @@ export function ToolWorkflowProvider({ children }: ToolWorkflowProviderProps) { }, []); const setReaderMode = useCallback((mode: boolean) => { + if (mode) { + actions.setWorkbench('viewer'); + actions.setSelectedTool('read'); + } dispatch({ type: 'SET_READER_MODE', payload: mode }); - }, []); + }, [actions]); const setPreviewFile = useCallback((file: File | null) => { dispatch({ type: 'SET_PREVIEW_FILE', payload: file });