Skip to content

Build your personal knowledge base with Trilium Notes

feat(client): allow triggering search on hash change

Elian Doran89767d01355f
diff --git a/src/public/app/components/app_context.ts b/src/public/app/components/app_context.ts
index bafeaaa608..8c62a55867 100644
--- a/src/public/app/components/app_context.ts
+++ b/src/public/app/components/app_context.ts
@@ -551,10 +551,12 @@ $(window).on("beforeunload", () => {
});
$(window).on("hashchange", function () {
- const { notePath, ntxId, viewScope } = linkService.parseNavigationStateFromUrl(window.location.href);
+ const { notePath, ntxId, viewScope, searchString } = linkService.parseNavigationStateFromUrl(window.location.href);
if (notePath || ntxId) {
appContext.tabManager.switchToNoteContext(ntxId, notePath, viewScope);
+ } else if (searchString) {
+ appContext.triggerCommand("searchNotes", { searchString });
}
});