mirror of
https://github.com/unraid/api.git
synced 2025-12-31 13:39:52 -06:00
feat(web): remove notification indicator pulse
the pulse was initially added to provide visual feedback when: 1. a new notification arrived 2. an alert notification was unread because we began using the legacy notify script, we now get a toast on new notifications. re:2, feedback on the pulse was mixed, so i'm removing it.
This commit is contained in:
committed by
Pujit Mehrotra
parent
99704a9dbb
commit
bc4708f405
@@ -2,7 +2,6 @@
|
||||
import { BellIcon, ExclamationTriangleIcon, ShieldExclamationIcon } from '@heroicons/vue/24/solid';
|
||||
import { cn } from '~/components/shadcn/utils';
|
||||
import { Importance, type OverviewQuery } from '~/composables/gql/graphql';
|
||||
import { onWatcherCleanup } from 'vue';
|
||||
|
||||
const props = defineProps<{ overview?: OverviewQuery['notifications']['overview'] }>();
|
||||
|
||||
@@ -37,25 +36,6 @@ const icon = computed<{ component: Component; color: string } | null>(() => {
|
||||
}
|
||||
return null;
|
||||
});
|
||||
|
||||
/** whether new notifications ocurred */
|
||||
const hasNewNotifications = ref(false);
|
||||
// watch for new notifications, set a temporary indicator when they're reveived
|
||||
watch(
|
||||
() => props.overview?.unread,
|
||||
(newVal, oldVal) => {
|
||||
if (!newVal || !oldVal) {
|
||||
return;
|
||||
}
|
||||
hasNewNotifications.value = newVal.total > oldVal.total;
|
||||
// lifetime of 'new notification' state
|
||||
const msToLive = 30_000;
|
||||
const timeout = setTimeout(() => {
|
||||
hasNewNotifications.value = false;
|
||||
}, msToLive);
|
||||
onWatcherCleanup(() => clearTimeout(timeout));
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
Reference in New Issue
Block a user