mirror of
https://github.com/koodo-reader/koodo-reader.git
synced 2026-10-08 13:53:02 -04:00
Fix optional chaining for electronAPI in note synchronization
This commit is contained in:
1 parent
473f6f3305
commit
5f3fd700fa
3 files changed
+10
-4
No files matched your search
@@ -171,8 +171,8 @@ class PopupNote extends React.Component<PopupNoteProps, PopupNoteState> {
|
||||
let noteSyncManager = new NoteSyncManager(
|
||||
DatabaseService,
|
||||
ConfigService,
|
||||
window.electronAPI.fs,
|
||||
window.electronAPI.path
|
||||
window.electronAPI?.fs,
|
||||
window.electronAPI?.path
|
||||
);
|
||||
noteSyncManager.syncNote(note, bookKey);
|
||||
});
|
||||
|
||||
@@ -143,6 +143,8 @@ class NavList extends React.Component<NavListProps, NavListState> {
|
||||
|
||||
handleCompositionStart = () => {
|
||||
this.setState({ isComposing: true });
|
||||
ConfigService.setReaderConfig("isTempLocked", "yes");
|
||||
ConfigService.setReaderConfig("isNavLocked", "yes");
|
||||
};
|
||||
|
||||
handleCompositionEnd = (event: React.CompositionEvent<HTMLInputElement>) => {
|
||||
@@ -150,6 +152,10 @@ class NavList extends React.Component<NavListProps, NavListState> {
|
||||
this.setState({ isComposing: false, searchKeyword: keyword }, () => {
|
||||
this.handleSearch(keyword);
|
||||
});
|
||||
if (ConfigService.getReaderConfig("isTempLocked") === "yes") {
|
||||
ConfigService.setReaderConfig("isNavLocked", "");
|
||||
ConfigService.setReaderConfig("isTempLocked", "");
|
||||
}
|
||||
};
|
||||
|
||||
async handleJump(cfi: string) {
|
||||
|
||||
@@ -85,8 +85,8 @@ export async function createHighlight(params: DigestParams): Promise<void> {
|
||||
let noteSyncManager = new NoteSyncManager(
|
||||
DatabaseService,
|
||||
ConfigService,
|
||||
window.electronAPI.fs,
|
||||
window.electronAPI.path
|
||||
window.electronAPI?.fs,
|
||||
window.electronAPI?.path
|
||||
);
|
||||
noteSyncManager.syncNote(highlight, bookKey);
|
||||
onSuccess?.();
|
||||
|
||||
Reference in new issue
Block a user