mirror of
https://github.com/ankitects/anki.git
synced 2025-09-23 00:12:25 -04:00
Fix legacy DuplicateLink handling
This commit is contained in:
parent
018a9db57b
commit
b79014814d
2 changed files with 8 additions and 3 deletions
|
@ -6,11 +6,15 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
import { searchInBrowser } from "@generated/backend";
|
import { searchInBrowser } from "@generated/backend";
|
||||||
import * as tr from "@generated/ftl";
|
import * as tr from "@generated/ftl";
|
||||||
import type { Note } from "@generated/anki/notes_pb";
|
import type { Note } from "@generated/anki/notes_pb";
|
||||||
|
import { bridgeCommand } from "@tslib/bridgecommand";
|
||||||
|
|
||||||
export let note: Note | null = null;
|
export let note: Note | null = null;
|
||||||
|
export let isLegacy: boolean;
|
||||||
|
|
||||||
function showDupes() {
|
function showDupes(event: MouseEvent) {
|
||||||
if (note) {
|
if (isLegacy) {
|
||||||
|
bridgeCommand("dupes");
|
||||||
|
} else if (note) {
|
||||||
searchInBrowser({
|
searchInBrowser({
|
||||||
filter: {
|
filter: {
|
||||||
case: "dupe",
|
case: "dupe",
|
||||||
|
@ -21,6 +25,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
event.preventDefault();
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -1463,7 +1463,7 @@ components and functionality for general note editing.
|
||||||
</svelte:fragment>
|
</svelte:fragment>
|
||||||
<FieldState>
|
<FieldState>
|
||||||
{#if cols[index] === "dupe"}
|
{#if cols[index] === "dupe"}
|
||||||
<DuplicateLink {note} />
|
<DuplicateLink {note} {isLegacy} />
|
||||||
{/if}
|
{/if}
|
||||||
{#if mode === "add"}
|
{#if mode === "add"}
|
||||||
<StickyBadge
|
<StickyBadge
|
||||||
|
|
Loading…
Reference in a new issue