diff --git a/src/components/popups/popupNote/component.tsx b/src/components/popups/popupNote/component.tsx index de3fb32d..c9067078 100644 --- a/src/components/popups/popupNote/component.tsx +++ b/src/components/popups/popupNote/component.tsx @@ -171,8 +171,8 @@ class PopupNote extends React.Component { let noteSyncManager = new NoteSyncManager( DatabaseService, ConfigService, - window.electronAPI.fs, - window.electronAPI.path + window.electronAPI?.fs, + window.electronAPI?.path ); noteSyncManager.syncNote(note, bookKey); }); diff --git a/src/containers/lists/navList/component.tsx b/src/containers/lists/navList/component.tsx index 055b3991..ee16f613 100644 --- a/src/containers/lists/navList/component.tsx +++ b/src/containers/lists/navList/component.tsx @@ -143,6 +143,8 @@ class NavList extends React.Component { handleCompositionStart = () => { this.setState({ isComposing: true }); + ConfigService.setReaderConfig("isTempLocked", "yes"); + ConfigService.setReaderConfig("isNavLocked", "yes"); }; handleCompositionEnd = (event: React.CompositionEvent) => { @@ -150,6 +152,10 @@ class NavList extends React.Component { this.setState({ isComposing: false, searchKeyword: keyword }, () => { this.handleSearch(keyword); }); + if (ConfigService.getReaderConfig("isTempLocked") === "yes") { + ConfigService.setReaderConfig("isNavLocked", ""); + ConfigService.setReaderConfig("isTempLocked", ""); + } }; async handleJump(cfi: string) { diff --git a/src/utils/reader/noteUtil.ts b/src/utils/reader/noteUtil.ts index 7931ac07..b73d6c2a 100644 --- a/src/utils/reader/noteUtil.ts +++ b/src/utils/reader/noteUtil.ts @@ -85,8 +85,8 @@ export async function createHighlight(params: DigestParams): Promise { let noteSyncManager = new NoteSyncManager( DatabaseService, ConfigService, - window.electronAPI.fs, - window.electronAPI.path + window.electronAPI?.fs, + window.electronAPI?.path ); noteSyncManager.syncNote(highlight, bookKey); onSuccess?.();