From f0e67c4cd33e812e15a9e9c48ea1a992499a4d45 Mon Sep 17 00:00:00 2001 From: llama <100429699+iamllama@users.noreply.github.com> Date: Thu, 9 Jan 2025 19:29:34 +0800 Subject: [PATCH] Fix image field not being saved if a mask is created too quickly (#3706) * commit image field immediately in setupMaskEditor * use saveFieldNow instead --- ts/editor/NoteEditor.svelte | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ts/editor/NoteEditor.svelte b/ts/editor/NoteEditor.svelte index 885200e07..f211e30ee 100644 --- a/ts/editor/NoteEditor.svelte +++ b/ts/editor/NoteEditor.svelte @@ -431,6 +431,9 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html imageOcclusionMode = options.mode; if (options.mode.kind === "add") { fieldStores[ioFields.image].set(options.html); + // the image field is set programmatically and does not need debouncing + // commit immediately to avoid a race condition with the occlusions field + saveFieldNow(); // new image is being added if (isIOImageLoaded) {