fix(fe): mask auto-run keyed on control, no settle loop
Key the auto-run off a controlKey (sheet:sensitivity) so it fires on mask entry and on each sheet/sensitivity edit, but never re-fires when approveMask settles the overlay - preventing both the empty-preview bug and an infinite settle loop.
This commit is contained in:
@@ -70,10 +70,12 @@
|
|||||||
|
|
||||||
let fileInput: HTMLInputElement;
|
let fileInput: HTMLInputElement;
|
||||||
|
|
||||||
// Auto-run the mask when entering the mask screen and whenever the sheet or
|
// Auto-run the mask so the overlay (and preview) populate without the owner
|
||||||
// sensitivity changes, so the overlay (and preview) is populated without the
|
// pressing Approve first. `controlKey` changes only on sheet/sensitivity
|
||||||
// owner having to press Approve first.
|
// edits (never on the overlay itself), so this fires on entry and on each
|
||||||
$: if (kind === 'mask' && cap.source && cap.source.widthPx > 0) {
|
// control change - but not when approveMask settles the overlay (no loop).
|
||||||
|
$: controlKey = kind === 'mask' && cap.control ? `${cap.control.sheet}:${cap.control.sensitivity}` : null;
|
||||||
|
$: if (controlKey && cap.source && cap.source.widthPx > 0) {
|
||||||
void session.approveMask();
|
void session.approveMask();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user