Skip to content

Commit 8761d05

Browse files
committed
feat(web): add confirmation before archiving or deleting all notifications
1 parent 3a9dc76 commit 8761d05

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

web/components/Notifications/Sidebar.vue

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,22 @@ const { mutate: archiveAll, loading: loadingArchiveAll } = useMutation(archiveAl
99
const { mutate: deleteAll, loading: loadingDeleteAll } = useMutation(deleteAllNotifications);
1010
const { teleportTarget, determineTeleportTarget } = useTeleport();
1111
const importance = ref<Importance | undefined>(undefined);
12+
13+
const confimAndArchiveAll = async () => {
14+
if (
15+
confirm('This will archive all notifications on your Unraid server. Continue?')
16+
) {
17+
await deleteAll();
18+
}
19+
};
20+
21+
const confimAndDeleteAll = async () => {
22+
if (
23+
confirm('This will permanently delete all notifications currently on your Unraid server. Continue?')
24+
) {
25+
await deleteAll();
26+
}
27+
};
1228
</script>
1329

1430
<template>
@@ -45,7 +61,7 @@ const importance = ref<Importance | undefined>(undefined);
4561
variant="link"
4662
size="sm"
4763
class="text-muted-foreground text-base p-0"
48-
@click="archiveAll"
64+
@click="confimAndArchiveAll"
4965
>
5066
Archive All
5167
</Button>
@@ -56,7 +72,7 @@ const importance = ref<Importance | undefined>(undefined);
5672
variant="link"
5773
size="sm"
5874
class="text-muted-foreground text-base p-0"
59-
@click="deleteAll"
75+
@click="confimAndDeleteAll"
6076
>
6177
Delete All
6278
</Button>

0 commit comments

Comments
 (0)