From df808727c8eb0bd8cbb49b928d70f47098e06bfe Mon Sep 17 00:00:00 2001 From: llama <100429699+iamllama@users.noreply.github.com> Date: Sat, 25 Jan 2025 15:36:21 +0800 Subject: [PATCH] fix changes to tags not being reflected when editing in io mode (#3768) --- ts/editor/NoteEditor.svelte | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ts/editor/NoteEditor.svelte b/ts/editor/NoteEditor.svelte index d0aea8466..01d5348e4 100644 --- a/ts/editor/NoteEditor.svelte +++ b/ts/editor/NoteEditor.svelte @@ -277,8 +277,10 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html hidden: hideFieldInOcclusionType(index, ioFields), })) as FieldData[]; + let lastSavedTags: string[] | null = null; function saveTags({ detail }: CustomEvent): void { tagAmount = detail.tags.filter((tag: string) => tag != "").length; + lastSavedTags = detail.tags; bridgeCommand(`saveTags:${JSON.stringify(detail.tags)}`); } @@ -535,6 +537,11 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html imageOcclusionMode, ); + $: if (isImageOcclusion && $ioMaskEditorVisible && lastSavedTags) { + setTags(lastSavedTags); + lastSavedTags = null; + } + onMount(() => { function wrap(before: string, after: string): void { if (!$focusedInput || !editingInputIsRichText($focusedInput)) {