From c2e40aabe4808d0a9e076c7c048695b0c3b6429c Mon Sep 17 00:00:00 2001 From: Connor Yoh Date: Fri, 4 Jul 2025 17:51:32 +0100 Subject: [PATCH] removed warnings and enter read mode when opening with a file --- frontend/src/pages/HomePage.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/src/pages/HomePage.tsx b/frontend/src/pages/HomePage.tsx index 2e5b1d508..93b96bcb0 100644 --- a/frontend/src/pages/HomePage.tsx +++ b/frontend/src/pages/HomePage.tsx @@ -4,6 +4,7 @@ import { useSearchParams } from "react-router-dom"; import { useToolParams } from "../hooks/useToolParams"; import { useFileWithUrl } from "../hooks/useFileWithUrl"; import { fileStorage } from "../services/fileStorage"; +import { fileOpenService } from '../services/fileOpenService'; import AddToPhotosIcon from "@mui/icons-material/AddToPhotos"; import ContentCutIcon from "@mui/icons-material/ContentCut"; import ZoomInMapIcon from "@mui/icons-material/ZoomInMap"; @@ -324,7 +325,6 @@ export default function HomePage({ openedFilePath }: HomePageProps) { console.log('Loading opened file:', openedFilePath); // Use the file open service to read the file - const { fileOpenService } = await import('../services/fileOpenService'); const fileData = await fileOpenService.readFileAsArrayBuffer(openedFilePath); if (!fileData) { @@ -337,9 +337,10 @@ export default function HomePage({ openedFilePath }: HomePageProps) { lastModified: Date.now() }); - // Add to active files and switch to viewer + // Add to active files, switch to viewer, and enable reader mode addToActiveFiles(file); setCurrentView('viewer'); + setReaderMode(true); console.log('Successfully loaded opened file:', fileData.fileName); } catch (error) {