Skip to content

Commit

Permalink
simplify delete dialog closing
Browse files Browse the repository at this point in the history
  • Loading branch information
hahn-kev committed Jan 6, 2025
1 parent 1e23768 commit 1ff874b
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions frontend/viewer/src/lib/entry-editor/DeleteDialog.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,17 @@
let requester: {
resolve: (result: boolean) => void
} | undefined = undefined;
function onClose() {
requester?.resolve(false);
requester = undefined;
open = false;
}
function confirm() {
requester?.resolve(true);
requester = undefined;
open = false;
resolve(true);
}
function cancel() {
requester?.resolve(false);
resolve(false);
}
function resolve(shouldDelete: boolean) {
requester?.resolve(shouldDelete);
requester = undefined;
open = false;
}
Expand All @@ -34,7 +31,7 @@
});
}
</script>
<Dialog {open} on:close={onClose} {loading} persistent={loading} style="height: auto">
<Dialog {open} on:close={cancel} {loading} persistent={loading} style="height: auto">
<div slot="title">Delete {subject}</div>
<div class="m-6">
<p>Are you sure you want to delete {subject}?</p>
Expand Down

0 comments on commit 1ff874b

Please sign in to comment.