From b79014814df3568c99ea1a6969682e595883ab9f Mon Sep 17 00:00:00 2001 From: Abdo Date: Sat, 30 Aug 2025 16:22:52 +0300 Subject: [PATCH] Fix legacy DuplicateLink handling --- ts/routes/editor/DuplicateLink.svelte | 9 +++++++-- ts/routes/editor/NoteEditor.svelte | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ts/routes/editor/DuplicateLink.svelte b/ts/routes/editor/DuplicateLink.svelte index d58083af3..b07bf6fcb 100644 --- a/ts/routes/editor/DuplicateLink.svelte +++ b/ts/routes/editor/DuplicateLink.svelte @@ -6,11 +6,15 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html import { searchInBrowser } from "@generated/backend"; import * as tr from "@generated/ftl"; import type { Note } from "@generated/anki/notes_pb"; + import { bridgeCommand } from "@tslib/bridgecommand"; export let note: Note | null = null; + export let isLegacy: boolean; - function showDupes() { - if (note) { + function showDupes(event: MouseEvent) { + if (isLegacy) { + bridgeCommand("dupes"); + } else if (note) { searchInBrowser({ filter: { case: "dupe", @@ -21,6 +25,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html }, }); } + event.preventDefault(); } diff --git a/ts/routes/editor/NoteEditor.svelte b/ts/routes/editor/NoteEditor.svelte index 60b03c1de..7e49dee49 100644 --- a/ts/routes/editor/NoteEditor.svelte +++ b/ts/routes/editor/NoteEditor.svelte @@ -1463,7 +1463,7 @@ components and functionality for general note editing. {#if cols[index] === "dupe"} - + {/if} {#if mode === "add"}