Skip to content

Commit

Permalink
Added latch for leave a star modal
Browse files Browse the repository at this point in the history
  • Loading branch information
mszula committed Nov 15, 2024
1 parent a13265e commit c8d0237
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib/components/LeaveAStarModal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
let ref: HTMLDialogElement;
let timedOut = false;
let showed = false;
onMount(() => {
if (localStorage.getItem('leaved-a-star')) {
Expand All @@ -15,8 +16,9 @@
}, 60 * 1000);
});
$: if (!$running && timedOut) {
$: if (!$running && timedOut && !showed) {
ref.showModal();
showed = true;
}
const click = () => {
Expand Down

0 comments on commit c8d0237

Please sign in to comment.