clear io image field when resetting in add mode (#3794)

This commit is contained in:
llama 2025-02-06 23:58:49 +08:00 committed by GitHub
parent f893ec63af
commit da8c0f0e9b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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();