mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 18:36:30 +01:00 
			
		
		
		
	chore: 🤖 fix webpack build error
This commit is contained in:
		| @@ -17,7 +17,7 @@ export default class ShortcutComponent extends Component implements EventListene | |||||||
|     } |     } | ||||||
|  |  | ||||||
|     bindNoteShortcutHandler(labelOrRow: AttributeRow) { |     bindNoteShortcutHandler(labelOrRow: AttributeRow) { | ||||||
|         const handler = () => appContext.tabManager.getActiveContext().setNote(labelOrRow.noteId); |         const handler = () => appContext.tabManager.getActiveContext()?.setNote(labelOrRow.noteId); | ||||||
|         const namespace = labelOrRow.attributeId; |         const namespace = labelOrRow.attributeId; | ||||||
|  |  | ||||||
|         if (labelOrRow.isDeleted) { |         if (labelOrRow.isDeleted) { | ||||||
|   | |||||||
| @@ -44,7 +44,7 @@ export default class TreeContextMenu implements SelectMenuItemEventListener<Tree | |||||||
|         const note = this.node.data.noteId ? await froca.getNote(this.node.data.noteId) : null; |         const note = this.node.data.noteId ? await froca.getNote(this.node.data.noteId) : null; | ||||||
|         const branch = froca.getBranch(this.node.data.branchId); |         const branch = froca.getBranch(this.node.data.branchId); | ||||||
|         const isNotRoot = note?.noteId !== "root"; |         const isNotRoot = note?.noteId !== "root"; | ||||||
|         const isHoisted = note?.noteId === appContext.tabManager.getActiveContext().hoistedNoteId; |         const isHoisted = note?.noteId === appContext.tabManager.getActiveContext()?.hoistedNoteId; | ||||||
|         const parentNote = isNotRoot && branch ? await froca.getNote(branch.parentNoteId) : null; |         const parentNote = isNotRoot && branch ? await froca.getNote(branch.parentNoteId) : null; | ||||||
|  |  | ||||||
|         // some actions don't support multi-note, so they are disabled when notes are selected, |         // some actions don't support multi-note, so they are disabled when notes are selected, | ||||||
| @@ -226,8 +226,8 @@ export default class TreeContextMenu implements SelectMenuItemEventListener<Tree | |||||||
|                 templateNoteId: templateNoteId |                 templateNoteId: templateNoteId | ||||||
|             }); |             }); | ||||||
|         } else if (command === "openNoteInSplit") { |         } else if (command === "openNoteInSplit") { | ||||||
|             const subContexts = appContext.tabManager.getActiveContext().getSubContexts(); |             const subContexts = appContext.tabManager.getActiveContext()?.getSubContexts(); | ||||||
|             const { ntxId } = subContexts[subContexts.length - 1]; |             const { ntxId } = subContexts?.[subContexts.length - 1] ?? {}; | ||||||
|  |  | ||||||
|             this.treeWidget.triggerCommand("openNewNoteSplit", { ntxId, notePath }); |             this.treeWidget.triggerCommand("openNewNoteSplit", { ntxId, notePath }); | ||||||
|         } else if (command === "convertNoteToAttachment") { |         } else if (command === "convertNoteToAttachment") { | ||||||
|   | |||||||
| @@ -152,10 +152,10 @@ async function deleteNotes(branchIdsToDelete: string[], forceDeleteAllClones = f | |||||||
| async function activateParentNotePath() { | async function activateParentNotePath() { | ||||||
|     // this is not perfect, maybe we should find the next/previous sibling, but that's more complex |     // this is not perfect, maybe we should find the next/previous sibling, but that's more complex | ||||||
|     const activeContext = appContext.tabManager.getActiveContext(); |     const activeContext = appContext.tabManager.getActiveContext(); | ||||||
|     const parentNotePathArr = activeContext.notePathArray.slice(0, -1); |     const parentNotePathArr = activeContext?.notePathArray.slice(0, -1); | ||||||
|  |  | ||||||
|     if (parentNotePathArr.length > 0) { |     if (parentNotePathArr && parentNotePathArr.length > 0) { | ||||||
|         activeContext.setNote(parentNotePathArr.join("/")); |         activeContext?.setNote(parentNotePathArr.join("/")); | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -457,13 +457,13 @@ function FrontendScriptApi(this: Api, startNote: FNote, currentNote: FNote, orig | |||||||
|     this.BasicWidget = BasicWidget; |     this.BasicWidget = BasicWidget; | ||||||
|  |  | ||||||
|     this.activateNote = async (notePath) => { |     this.activateNote = async (notePath) => { | ||||||
|         await appContext.tabManager.getActiveContext().setNote(notePath); |         await appContext.tabManager.getActiveContext()?.setNote(notePath); | ||||||
|     }; |     }; | ||||||
|  |  | ||||||
|     this.activateNewNote = async (notePath) => { |     this.activateNewNote = async (notePath) => { | ||||||
|         await ws.waitForMaxKnownEntityChangeId(); |         await ws.waitForMaxKnownEntityChangeId(); | ||||||
|  |  | ||||||
|         await appContext.tabManager.getActiveContext().setNote(notePath); |         await appContext.tabManager.getActiveContext()?.setNote(notePath); | ||||||
|         await appContext.triggerEvent("focusAndSelectTitle", {}); |         await appContext.triggerEvent("focusAndSelectTitle", {}); | ||||||
|     }; |     }; | ||||||
|  |  | ||||||
| @@ -480,8 +480,8 @@ function FrontendScriptApi(this: Api, startNote: FNote, currentNote: FNote, orig | |||||||
|     this.openSplitWithNote = async (notePath, activate) => { |     this.openSplitWithNote = async (notePath, activate) => { | ||||||
|         await ws.waitForMaxKnownEntityChangeId(); |         await ws.waitForMaxKnownEntityChangeId(); | ||||||
|  |  | ||||||
|         const subContexts = appContext.tabManager.getActiveContext().getSubContexts(); |         const subContexts = appContext.tabManager.getActiveContext()?.getSubContexts(); | ||||||
|         const { ntxId } = subContexts[subContexts.length - 1]; |         const { ntxId } = subContexts?.[subContexts.length - 1] ?? {}; | ||||||
|  |  | ||||||
|         await appContext.triggerCommand("openNewNoteSplit", { ntxId, notePath }); |         await appContext.triggerCommand("openNewNoteSplit", { ntxId, notePath }); | ||||||
|  |  | ||||||
| @@ -591,15 +591,48 @@ function FrontendScriptApi(this: Api, startNote: FNote, currentNote: FNote, orig | |||||||
|  |  | ||||||
|     this.addTextToActiveContextEditor = (text) => appContext.triggerCommand("addTextToActiveEditor", { text }); |     this.addTextToActiveContextEditor = (text) => appContext.triggerCommand("addTextToActiveEditor", { text }); | ||||||
|  |  | ||||||
|     this.getActiveContextNote = () => appContext.tabManager.getActiveContextNote(); |     this.getActiveContextNote = (): FNote => { | ||||||
|     this.getActiveContext = () => appContext.tabManager.getActiveContext(); |         const note = appContext.tabManager.getActiveContextNote(); | ||||||
|     this.getActiveMainContext = () => appContext.tabManager.getActiveMainContext(); |         if (!note) { | ||||||
|  |             throw new Error("No active context note found"); | ||||||
|  |         } | ||||||
|  |         return note; | ||||||
|  |     }; | ||||||
|  |  | ||||||
|  |     this.getActiveContext = (): NoteContext => { | ||||||
|  |         const context = appContext.tabManager.getActiveContext(); | ||||||
|  |         if (!context) { | ||||||
|  |             throw new Error("No active context found"); | ||||||
|  |         } | ||||||
|  |         return context; | ||||||
|  |     }; | ||||||
|  |  | ||||||
|  |     this.getActiveMainContext = (): NoteContext => { | ||||||
|  |         const context = appContext.tabManager.getActiveMainContext(); | ||||||
|  |         if (!context) { | ||||||
|  |             throw new Error("No active main context found"); | ||||||
|  |         } | ||||||
|  |         return context; | ||||||
|  |     }; | ||||||
|  |  | ||||||
|     this.getNoteContexts = () => appContext.tabManager.getNoteContexts(); |     this.getNoteContexts = () => appContext.tabManager.getNoteContexts(); | ||||||
|     this.getMainNoteContexts = () => appContext.tabManager.getMainNoteContexts(); |     this.getMainNoteContexts = () => appContext.tabManager.getMainNoteContexts(); | ||||||
|  |  | ||||||
|     this.getActiveContextTextEditor = () => appContext.tabManager.getActiveContext()?.getTextEditor(); |     this.getActiveContextTextEditor = () => { | ||||||
|     this.getActiveContextCodeEditor = () => appContext.tabManager.getActiveContext()?.getCodeEditor(); |         const context = appContext.tabManager.getActiveContext(); | ||||||
|  |         if (!context) { | ||||||
|  |             throw new Error("No active context found"); | ||||||
|  |         } | ||||||
|  |         return context.getTextEditor(); | ||||||
|  |     }; | ||||||
|  |  | ||||||
|  |     this.getActiveContextCodeEditor = () => { | ||||||
|  |         const context = appContext.tabManager.getActiveContext(); | ||||||
|  |         if (!context) { | ||||||
|  |             throw new Error("No active context found"); | ||||||
|  |         } | ||||||
|  |         return context.getCodeEditor(); | ||||||
|  |     }; | ||||||
|  |  | ||||||
|     this.getActiveNoteDetailWidget = () => new Promise((resolve) => appContext.triggerCommand("executeInActiveNoteDetailWidget", { callback: resolve })); |     this.getActiveNoteDetailWidget = () => new Promise((resolve) => appContext.triggerCommand("executeInActiveNoteDetailWidget", { callback: resolve })); | ||||||
|     this.getActiveContextNotePath = () => appContext.tabManager.getActiveContextNotePath(); |     this.getActiveContextNotePath = () => appContext.tabManager.getActiveContextNotePath(); | ||||||
|   | |||||||
| @@ -80,7 +80,7 @@ ws.subscribeToMessages(async (message) => { | |||||||
|         toastService.showPersistent(toast); |         toastService.showPersistent(toast); | ||||||
|  |  | ||||||
|         if (message.result.importedNoteId) { |         if (message.result.importedNoteId) { | ||||||
|             await appContext.tabManager.getActiveContext().setNote(message.result.importedNoteId); |             await appContext.tabManager.getActiveContext()?.setNote(message.result.importedNoteId); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| }); | }); | ||||||
| @@ -102,7 +102,7 @@ ws.subscribeToMessages(async (message) => { | |||||||
|         toastService.showPersistent(toast); |         toastService.showPersistent(toast); | ||||||
|  |  | ||||||
|         if (message.result.parentNoteId) { |         if (message.result.parentNoteId) { | ||||||
|             await appContext.tabManager.getActiveContext().setNote(message.result.importedNoteId, { |             await appContext.tabManager.getActiveContext()?.setNote(message.result.importedNoteId, { | ||||||
|                 viewScope: { |                 viewScope: { | ||||||
|                     viewMode: "attachments" |                     viewMode: "attachments" | ||||||
|                 } |                 } | ||||||
|   | |||||||
| @@ -86,8 +86,8 @@ async function createNote(parentNotePath: string | undefined, options: CreateNot | |||||||
|  |  | ||||||
|     await ws.waitForMaxKnownEntityChangeId(); |     await ws.waitForMaxKnownEntityChangeId(); | ||||||
|  |  | ||||||
|     if (options.activate) { |  | ||||||
|     const activeNoteContext = appContext.tabManager.getActiveContext(); |     const activeNoteContext = appContext.tabManager.getActiveContext(); | ||||||
|  |     if (activeNoteContext && options.activate) { | ||||||
|         await activeNoteContext.setNote(`${parentNotePath}/${note.noteId}`); |         await activeNoteContext.setNote(`${parentNotePath}/${note.noteId}`); | ||||||
|  |  | ||||||
|         if (options.focus === "title") { |         if (options.focus === "title") { | ||||||
| @@ -152,8 +152,7 @@ async function duplicateSubtree(noteId: string, parentNotePath: string) { | |||||||
|  |  | ||||||
|     await ws.waitForMaxKnownEntityChangeId(); |     await ws.waitForMaxKnownEntityChangeId(); | ||||||
|  |  | ||||||
|     const activeNoteContext = appContext.tabManager.getActiveContext(); |     appContext.tabManager.getActiveContext()?.setNote(`${parentNotePath}/${note.noteId}`); | ||||||
|     activeNoteContext.setNote(`${parentNotePath}/${note.noteId}`); |  | ||||||
|  |  | ||||||
|     const origNote = await froca.getNote(noteId); |     const origNote = await froca.getNote(noteId); | ||||||
|     toastService.showMessage(t("note_create.duplicated", { title: origNote?.title })); |     toastService.showMessage(t("note_create.duplicated", { title: origNote?.title })); | ||||||
|   | |||||||
| @@ -171,7 +171,7 @@ export default class AttachmentActionsWidget extends BasicWidget { | |||||||
|         const { note: newNote } = await server.post<ReturnType<typeof attachmentsApiRoute.convertAttachmentToNote>>(`attachments/${this.attachmentId}/convert-to-note`); |         const { note: newNote } = await server.post<ReturnType<typeof attachmentsApiRoute.convertAttachmentToNote>>(`attachments/${this.attachmentId}/convert-to-note`); | ||||||
|         toastService.showMessage(t("attachments_actions.convert_success", { title: this.attachment.title })); |         toastService.showMessage(t("attachments_actions.convert_success", { title: this.attachment.title })); | ||||||
|         await ws.waitForMaxKnownEntityChangeId(); |         await ws.waitForMaxKnownEntityChangeId(); | ||||||
|         await appContext.tabManager.getActiveContext().setNote(newNote.noteId); |         await appContext.tabManager.getActiveContext()?.setNote(newNote.noteId); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     async renameAttachmentCommand() { |     async renameAttachmentCommand() { | ||||||
|   | |||||||
| @@ -149,7 +149,7 @@ export default class CalendarWidget extends RightDropdownButtonWidget { | |||||||
|                 const note = await dateNoteService.getDayNote(date); |                 const note = await dateNoteService.getDayNote(date); | ||||||
|  |  | ||||||
|                 if (note) { |                 if (note) { | ||||||
|                     appContext.tabManager.getActiveContext().setNote(note.noteId); |                     appContext.tabManager.getActiveContext()?.setNote(note.noteId); | ||||||
|                     this.dropdown?.hide(); |                     this.dropdown?.hide(); | ||||||
|                 } else { |                 } else { | ||||||
|                     toastService.showError(t("calendar.cannot_find_day_note")); |                     toastService.showError(t("calendar.cannot_find_day_note")); | ||||||
| @@ -189,10 +189,7 @@ export default class CalendarWidget extends RightDropdownButtonWidget { | |||||||
|  |  | ||||||
|     async dropdownShown() { |     async dropdownShown() { | ||||||
|         await libraryLoader.requireLibrary(libraryLoader.CALENDAR_WIDGET); |         await libraryLoader.requireLibrary(libraryLoader.CALENDAR_WIDGET); | ||||||
|  |         this.init(appContext.tabManager.getActiveContextNote()?.getOwnedLabelValue("dateNote") ?? null); | ||||||
|         const activeNote = appContext.tabManager.getActiveContextNote(); |  | ||||||
|  |  | ||||||
|         this.init(activeNote?.getOwnedLabelValue("dateNote")); |  | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     init(activeDate: string | null) { |     init(activeDate: string | null) { | ||||||
|   | |||||||
| @@ -78,7 +78,7 @@ export default class NoteLauncher extends AbstractLauncher { | |||||||
|     } |     } | ||||||
|  |  | ||||||
|     getHoistedNoteId() { |     getHoistedNoteId() { | ||||||
|         return this.launcherNote.getRelationValue("hoistedNote") || appContext.tabManager.getActiveContext().hoistedNoteId; |         return this.launcherNote.getRelationValue("hoistedNote") || appContext.tabManager.getActiveContext()?.hoistedNoteId; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     getTitle() { |     getTitle() { | ||||||
|   | |||||||
| @@ -10,6 +10,6 @@ export default class TodayLauncher extends NoteLauncher { | |||||||
|     } |     } | ||||||
|  |  | ||||||
|     getHoistedNoteId() { |     getHoistedNoteId() { | ||||||
|         return appContext.tabManager.getActiveContext().hoistedNoteId; |         return appContext.tabManager.getActiveContext()?.hoistedNoteId; | ||||||
|     } |     } | ||||||
| } | } | ||||||
|   | |||||||
| @@ -228,7 +228,7 @@ export default class NoteActionsWidget extends NoteContextAwareWidget { | |||||||
|  |  | ||||||
|         toastService.showMessage(t("note_actions.convert_into_attachment_successful", { title: newAttachment.title })); |         toastService.showMessage(t("note_actions.convert_into_attachment_successful", { title: newAttachment.title })); | ||||||
|         await ws.waitForMaxKnownEntityChangeId(); |         await ws.waitForMaxKnownEntityChangeId(); | ||||||
|         await appContext.tabManager.getActiveContext().setNote(newAttachment.ownerId, { |         await appContext.tabManager.getActiveContext()?.setNote(newAttachment.ownerId, { | ||||||
|             viewScope: { |             viewScope: { | ||||||
|                 viewMode: "attachments", |                 viewMode: "attachments", | ||||||
|                 attachmentId: newAttachment.attachmentId |                 attachmentId: newAttachment.attachmentId | ||||||
|   | |||||||
| @@ -24,8 +24,7 @@ export default class LeftPaneContainer extends FlexContainer<Component> { | |||||||
|             if (visible) { |             if (visible) { | ||||||
|                 this.triggerEvent("focusTree", {}); |                 this.triggerEvent("focusTree", {}); | ||||||
|             } else { |             } else { | ||||||
|                 const activeNoteContext = appContext.tabManager.getActiveContext(); |                 this.triggerEvent("focusOnDetail", { ntxId: appContext.tabManager.getActiveContext()?.ntxId }); | ||||||
|                 this.triggerEvent("focusOnDetail", { ntxId: activeNoteContext.ntxId }); |  | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|   | |||||||
| @@ -65,7 +65,7 @@ export default class CodeButtonsWidget extends NoteContextAwareWidget { | |||||||
|  |  | ||||||
|             await ws.waitForMaxKnownEntityChangeId(); |             await ws.waitForMaxKnownEntityChangeId(); | ||||||
|  |  | ||||||
|             await appContext.tabManager.getActiveContext().setNote(notePath); |             await appContext.tabManager.getActiveContext()?.setNote(notePath); | ||||||
|  |  | ||||||
|             toastService.showMessage(t("code_buttons.sql_console_saved_message", { notePath: await treeService.getNotePathTitle(notePath) })); |             toastService.showMessage(t("code_buttons.sql_console_saved_message", { notePath: await treeService.getNotePathTitle(notePath) })); | ||||||
|         }); |         }); | ||||||
|   | |||||||
| @@ -60,15 +60,15 @@ export default class ContextualHelpButton extends NoteContextAwareWidget { | |||||||
|     doRender() { |     doRender() { | ||||||
|         this.$widget = $(TPL); |         this.$widget = $(TPL); | ||||||
|         this.$widget.on("click", () => { |         this.$widget.on("click", () => { | ||||||
|             const subContexts = appContext.tabManager.getActiveContext().getSubContexts(); |             const subContexts = appContext.tabManager.getActiveContext()?.getSubContexts(); | ||||||
|             const targetNote = `_help_${this.helpNoteIdToOpen}`; |             const targetNote = `_help_${this.helpNoteIdToOpen}`; | ||||||
|             const helpSubcontext = subContexts.find((s) => s.viewScope?.viewMode === "contextual-help"); |             const helpSubcontext = subContexts?.find((s) => s.viewScope?.viewMode === "contextual-help"); | ||||||
|             const viewScope: ViewScope = { |             const viewScope: ViewScope = { | ||||||
|                 viewMode: "contextual-help" |                 viewMode: "contextual-help" | ||||||
|             }; |             }; | ||||||
|             if (!helpSubcontext) { |             if (!helpSubcontext) { | ||||||
|                 // The help is not already open, open a new split with it. |                 // The help is not already open, open a new split with it. | ||||||
|                 const { ntxId } = subContexts[subContexts.length - 1]; |                 const { ntxId } = subContexts?.[subContexts.length - 1] ?? {}; | ||||||
|                 this.triggerCommand("openNewNoteSplit", { |                 this.triggerCommand("openNewNoteSplit", { | ||||||
|                     ntxId, |                     ntxId, | ||||||
|                     notePath: targetNote, |                     notePath: targetNote, | ||||||
|   | |||||||
| @@ -28,8 +28,8 @@ class MobileDetailMenuWidget extends BasicWidget { | |||||||
|                 x: e.pageX, |                 x: e.pageX, | ||||||
|                 y: e.pageY, |                 y: e.pageY, | ||||||
|                 items: [ |                 items: [ | ||||||
|                     { title: t("mobile_detail_menu.insert_child_note"), command: "insertChildNote", uiIcon: "bx bx-plus", enabled: note.type !== "search" }, |                     { title: t("mobile_detail_menu.insert_child_note"), command: "insertChildNote", uiIcon: "bx bx-plus", enabled: note?.type !== "search" }, | ||||||
|                     { title: t("mobile_detail_menu.delete_this_note"), command: "delete", uiIcon: "bx bx-trash", enabled: note.noteId !== "root" } |                     { title: t("mobile_detail_menu.delete_this_note"), command: "delete", uiIcon: "bx bx-trash", enabled: note?.noteId !== "root" } | ||||||
|                 ], |                 ], | ||||||
|                 selectMenuItemHandler: async ({ command }) => { |                 selectMenuItemHandler: async ({ command }) => { | ||||||
|                     if (command === "insertChildNote") { |                     if (command === "insertChildNote") { | ||||||
|   | |||||||
| @@ -322,7 +322,7 @@ export default class NoteMapWidget extends NoteContextAwareWidget { | |||||||
|             .warmupTicks(30) |             .warmupTicks(30) | ||||||
|             .onNodeClick((node) => { |             .onNodeClick((node) => { | ||||||
|                 if (node.id) { |                 if (node.id) { | ||||||
|                     appContext.tabManager.getActiveContext().setNote((node as Node).id); |                     appContext.tabManager.getActiveContext()?.setNote((node as Node).id); | ||||||
|                 } |                 } | ||||||
|             }) |             }) | ||||||
|             .onNodeRightClick((node, e) => { |             .onNodeRightClick((node, e) => { | ||||||
| @@ -371,7 +371,7 @@ export default class NoteMapWidget extends NoteContextAwareWidget { | |||||||
|         if (mapRootNoteId === "hoisted") { |         if (mapRootNoteId === "hoisted") { | ||||||
|             mapRootNoteId = hoistedNoteService.getHoistedNoteId(); |             mapRootNoteId = hoistedNoteService.getHoistedNoteId(); | ||||||
|         } else if (!mapRootNoteId) { |         } else if (!mapRootNoteId) { | ||||||
|             mapRootNoteId = appContext.tabManager.getActiveContext().parentNoteId; |             mapRootNoteId = appContext.tabManager.getActiveContext()?.parentNoteId; | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         return mapRootNoteId ?? ""; |         return mapRootNoteId ?? ""; | ||||||
|   | |||||||
| @@ -424,10 +424,10 @@ export default class NoteTreeWidget extends NoteContextAwareWidget { | |||||||
|  |  | ||||||
|                 const activeNoteContext = appContext.tabManager.getActiveContext(); |                 const activeNoteContext = appContext.tabManager.getActiveContext(); | ||||||
|                 const opts: SetNoteOpts = {}; |                 const opts: SetNoteOpts = {}; | ||||||
|                 if (activeNoteContext.viewScope?.viewMode === "contextual-help") { |                 if (activeNoteContext?.viewScope?.viewMode === "contextual-help") { | ||||||
|                     opts.viewScope = activeNoteContext.viewScope; |                     opts.viewScope = activeNoteContext.viewScope; | ||||||
|                 } |                 } | ||||||
|                 await activeNoteContext.setNote(notePath, opts); |                 await activeNoteContext?.setNote(notePath, opts); | ||||||
|             }, |             }, | ||||||
|             expand: (event, data) => this.setExpanded(data.node.data.branchId, true), |             expand: (event, data) => this.setExpanded(data.node.data.branchId, true), | ||||||
|             collapse: (event, data) => this.setExpanded(data.node.data.branchId, false), |             collapse: (event, data) => this.setExpanded(data.node.data.branchId, false), | ||||||
| @@ -1758,6 +1758,6 @@ export default class NoteTreeWidget extends NoteContextAwareWidget { | |||||||
|  |  | ||||||
|         await ws.waitForMaxKnownEntityChangeId(); |         await ws.waitForMaxKnownEntityChangeId(); | ||||||
|  |  | ||||||
|         appContext.tabManager.getActiveContext().setNote(resp.note.noteId); |         appContext.tabManager.getActiveContext()?.setNote(resp.note.noteId); | ||||||
|     } |     } | ||||||
| } | } | ||||||
|   | |||||||
| @@ -246,7 +246,7 @@ export default class SearchDefinitionWidget extends NoteContextAwareWidget { | |||||||
|  |  | ||||||
|             await ws.waitForMaxKnownEntityChangeId(); |             await ws.waitForMaxKnownEntityChangeId(); | ||||||
|  |  | ||||||
|             await appContext.tabManager.getActiveContext().setNote(notePath); |             await appContext.tabManager.getActiveContext()?.setNote(notePath); | ||||||
|             // Note the {{- notePathTitle}} in json file is not typo, it's unescaping |             // Note the {{- notePathTitle}} in json file is not typo, it's unescaping | ||||||
|             // See https://www.i18next.com/translation-function/interpolation#unescape |             // See https://www.i18next.com/translation-function/interpolation#unescape | ||||||
|             toastService.showMessage(t("search_definition.search_note_saved", { notePathTitle: await treeService.getNotePathTitle(notePath) })); |             toastService.showMessage(t("search_definition.search_note_saved", { notePathTitle: await treeService.getNotePathTitle(notePath) })); | ||||||
|   | |||||||
| @@ -155,7 +155,7 @@ export default class CalendarView extends ViewMode { | |||||||
|  |  | ||||||
|                 const note = await date_notes.getDayNote(e.dateStr); |                 const note = await date_notes.getDayNote(e.dateStr); | ||||||
|                 if (note) { |                 if (note) { | ||||||
|                     appContext.tabManager.getActiveContext().setNote(note.noteId); |                     appContext.tabManager.getActiveContext()?.setNote(note.noteId); | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|         }); |         }); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user