refactor: 💡 Fix ts error

This commit is contained in:
Jin
2025-03-18 18:44:48 +01:00
parent e12be14dc9
commit b18cfb5d20
5 changed files with 27 additions and 8 deletions

View File

@@ -140,13 +140,19 @@ export default class QuickSearchWidget extends BasicWidget {
if (!e.target || e.target.nodeName !== "A") {
// click on the link is handled by link handling, but we want the whole item clickable
appContext.tabManager.getActiveContext().setNote(note.noteId);
const activeContext = appContext.tabManager.getActiveContext();
if (activeContext) {
activeContext.setNote(note.noteId);
}
}
});
shortcutService.bindElShortcut($link, "return", () => {
this.dropdown.hide();
appContext.tabManager.getActiveContext().setNote(note.noteId);
const activeContext = appContext.tabManager.getActiveContext();
if (activeContext) {
activeContext.setNote(note.noteId);
}
});
this.$dropdownMenu.append($link);