added setting

This commit is contained in:
KevinWh0 2024-03-16 01:23:02 +01:00
parent 395ea9ab9f
commit 8f300cf460
7 changed files with 17 additions and 6 deletions

View file

@ -80,8 +80,6 @@ class NotificationFavIconDot {
constructor() {
this.canvas = document.createElement('canvas');
if (this.faviconEL == null) return;
this.src = this.faviconEL.getAttribute('href');
this.ctx = this.canvas.getContext('2d');
@ -162,11 +160,11 @@ function onNotification(notification: Misskey.entities.Notification, isClient =
if ($i) {
const connection = useStream().useChannel('main', null, 'UI');
connection.on('notification', onNotification);
watch(() => $i?.hasUnreadNotification, (hasAny) => notificationDot.setVisible(hasAny ?? false));
if ($i.hasUnreadNotification) notificationDot.setVisible(true);
watch(() => $i?.hasUnreadNotification, (hasAny) => notificationDot.setVisible((defaultStore.state.enableFaviconNotificationDot ? hasAny : false) ?? false));
if ($i.hasUnreadNotification && defaultStore.state.enableFaviconNotificationDot) notificationDot.setVisible(true);
globalEvents.on('clientNotification', notification => onNotification(notification, true));
//#region Listen message from SW