Skip to content

Commit

Permalink
update: hide all alerts on cancel.
Browse files Browse the repository at this point in the history
  • Loading branch information
ItzNotABug committed Oct 1, 2024
1 parent ab67b7f commit 6406b55
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/lib/components/bottomModalAlert.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,12 @@
$: currentModalAlert = filteredModalAlerts[currentIndex] as BottomModalAlertItem;
function handleClose() {
const modalAlert = currentModalAlert;
dismissBottomModalAlert(modalAlert.id);
hideNotification(modalAlert.id, { coolOffPeriod: 24 * 365 });
if (modalAlert.closed) modalAlert.closed();
if (currentIndex === filteredModalAlerts.length - 1 && filteredModalAlerts.length > 1) {
currentIndex = currentIndex - 1;
} else {
currentIndex = currentIndex % filteredModalAlerts.length;
}
filteredModalAlerts.forEach((alert) => {
const modalAlert = alert;
dismissBottomModalAlert(modalAlert.id);
hideNotification(modalAlert.id, { coolOffPeriod: 24 * 365 });
if (modalAlert.closed) modalAlert.closed();
});
}
function showNext() {
Expand Down

0 comments on commit 6406b55

Please sign in to comment.