Fix mask editor disappearing when saveNow() called

Closes #2619
This commit is contained in:
Damien Elmes 2023-09-17 11:49:30 +10:00
parent 170ab60a52
commit c0b4b3d0e7

View file

@ -302,7 +302,6 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
closeMathjaxEditor?.(); closeMathjaxEditor?.();
$commitTagEdits(); $commitTagEdits();
saveFieldNow(); saveFieldNow();
imageOcclusionMode = undefined;
} }
export function saveOnPageHide() { export function saveOnPageHide() {
@ -400,6 +399,8 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
let isIOImageLoaded = false; let isIOImageLoaded = false;
let imageOcclusionMode: IOMode | undefined; let imageOcclusionMode: IOMode | undefined;
async function setupMaskEditor(options: { html: string; mode: IOMode }) { async function setupMaskEditor(options: { html: string; mode: IOMode }) {
imageOcclusionMode = undefined;
await tick();
imageOcclusionMode = options.mode; imageOcclusionMode = options.mode;
if (options.mode.kind === "add") { if (options.mode.kind === "add") {
fieldStores[1].set(options.html); fieldStores[1].set(options.html);