fix: use correct condition

This commit is contained in:
madkarmaa
2025-11-24 12:35:57 +01:00
parent 536c4fe20d
commit 6aaba560d5
2 changed files with 2 additions and 5 deletions

View File

@@ -14,10 +14,7 @@
let isTopModal = $derived(modalsStack.isTopModal(id));
$effect(() => {
if (open)
modalsStack.push(id, () => {
open = false;
});
if (open) modalsStack.push(id, () => (open = false));
else modalsStack.pop(id);
});
</script>

View File

@@ -20,7 +20,7 @@ class ModalStack {
}
closeTop() {
if (this.stack.length < 0) return;
if (this.stack.length <= 0) return;
const topId = this.stack[this.stack.length - 1];
this.modals.get(topId)?.();
}