From da8c0f0e9bc178854d5ec87afff942fbd596441e Mon Sep 17 00:00:00 2001 From: llama <100429699+iamllama@users.noreply.github.com> Date: Thu, 6 Feb 2025 23:58:49 +0800 Subject: [PATCH] clear io image field when resetting in add mode (#3794) --- ts/editor/NoteEditor.svelte | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ts/editor/NoteEditor.svelte b/ts/editor/NoteEditor.svelte index 01d5348e4..bf959e266 100644 --- a/ts/editor/NoteEditor.svelte +++ b/ts/editor/NoteEditor.svelte @@ -471,6 +471,11 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html isIOImageLoaded = false; globalThis.canvas.clear(); globalThis.canvas = undefined; + if (imageOcclusionMode?.kind === "add") { + // canvas.clear indirectly calls saveOcclusions + saveFieldNow(); + fieldStores[ioFields.image].set(""); + } const page = document.querySelector(".image-occlusion"); if (page) { page.remove();