From ab1552bc5dd5f19fb028005d7e781b89bab9d0b6 Mon Sep 17 00:00:00 2001 From: okxint Date: Sun, 22 Mar 2026 20:01:58 +0530 Subject: [PATCH] fix: clear pending timers before scheduling new ones to prevent leaks --- .../note-node/note-editor/plugins/link-editor-plugin/hooks.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/web/app/components/workflow/note-node/note-editor/plugins/link-editor-plugin/hooks.ts b/web/app/components/workflow/note-node/note-editor/plugins/link-editor-plugin/hooks.ts index 94f6fd673b..9b12a88138 100644 --- a/web/app/components/workflow/note-node/note-editor/plugins/link-editor-plugin/hooks.ts +++ b/web/app/components/workflow/note-node/note-editor/plugins/link-editor-plugin/hooks.ts @@ -29,6 +29,7 @@ export const useOpenLink = () => { const unregister = mergeRegister( editor.registerUpdateListener(() => { + clearTimeout(updateTimer) updateTimer = setTimeout(() => { const { selectedLinkUrl, @@ -54,6 +55,7 @@ export const useOpenLink = () => { editor.registerCommand( CLICK_COMMAND, (payload) => { + clearTimeout(clickTimer) clickTimer = setTimeout(() => { const { selectedLinkUrl,