From 51eb9f18f723112a781b335a1dce22f2b2dd05d4 Mon Sep 17 00:00:00 2001 From: FliegendeWurst <2012gdwu@web.de> Date: Fri, 2 Oct 2020 21:12:13 +0200 Subject: [PATCH] Jump to note dialog: fix duplicate event triggers (#1283) This fixes an issue where the current path (above the note tree) displays parts multiple times, e.g. A / A / B / B instead of A / B. The same issue could also affect other event handlers, but I didn't look around the codebase further. --- src/public/app/dialogs/jump_to_note.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/public/app/dialogs/jump_to_note.js b/src/public/app/dialogs/jump_to_note.js index 172c9f2ff..378b6876d 100644 --- a/src/public/app/dialogs/jump_to_note.js +++ b/src/public/app/dialogs/jump_to_note.js @@ -13,6 +13,8 @@ export async function showDialog() { utils.openDialog($dialog); noteAutocompleteService.initNoteAutocomplete($autoComplete, { hideGoToSelectedNoteButton: true }) + // clear any event listener added in previous invocation of this function + .off('autocomplete:noteselected') .on('autocomplete:noteselected', function(event, suggestion, dataset) { if (!suggestion.notePath) { return false;