From 4c663dc69c4f67fea982a121ee387733f2759a62 Mon Sep 17 00:00:00 2001 From: Pujit Mehrotra Date: Mon, 18 Nov 2024 13:38:17 -0500 Subject: [PATCH] feat(web): add confirmation before archiving or deleting all notifications --- web/components/Notifications/Sidebar.vue | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/web/components/Notifications/Sidebar.vue b/web/components/Notifications/Sidebar.vue index 8c50fcb93..cf2f54a59 100644 --- a/web/components/Notifications/Sidebar.vue +++ b/web/components/Notifications/Sidebar.vue @@ -9,6 +9,22 @@ const { mutate: archiveAll, loading: loadingArchiveAll } = useMutation(archiveAl const { mutate: deleteAll, loading: loadingDeleteAll } = useMutation(deleteAllNotifications); const { teleportTarget, determineTeleportTarget } = useTeleport(); const importance = ref(undefined); + +const confirmAndArchiveAll = async () => { + if ( + confirm('This will archive all notifications on your Unraid server. Continue?') + ) { + await archiveAll(); + } +}; + +const confirmAndDeleteAll = async () => { + if ( + confirm('This will permanently delete all notifications currently on your Unraid server. Continue?') + ) { + await deleteAll(); + } +};