mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2025-07-27 07:35:22 +00:00
removed warnings and enter read mode when opening with a file
This commit is contained in:
parent
a56dac76ac
commit
c2e40aabe4
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user