Fix image field not being saved if a mask is created too quickly (#3706)

* commit image field immediately in setupMaskEditor

* use saveFieldNow instead
This commit is contained in:
llama 2025-01-09 19:29:34 +08:00 committed by GitHub
parent 1bdd7f706f
commit f0e67c4cd3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -431,6 +431,9 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
imageOcclusionMode = options.mode; imageOcclusionMode = options.mode;
if (options.mode.kind === "add") { if (options.mode.kind === "add") {
fieldStores[ioFields.image].set(options.html); 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 // new image is being added
if (isIOImageLoaded) { if (isIOImageLoaded) {