Skip to content

Commit 85ee1ac

Browse files
committed
feat: implement taskbar icon blinking for notifications
1 parent 49261f5 commit 85ee1ac

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/notifications/main.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ const createNotification = async (
8686
});
8787

8888
const notificationType = notificationTypes.get(id);
89-
if (notificationType === 'voice') {
89+
90+
// Only flash for chat-related notifications
91+
if (notificationType === 'text' || notificationType === 'voice') {
9092
attentionDrawing.drawAttention(id);
9193
}
9294
});
@@ -99,10 +101,9 @@ const createNotification = async (
99101
});
100102
notifications.delete(id);
101103

102-
const notificationType = notificationTypes.get(id);
103-
if (notificationType === 'voice') {
104-
attentionDrawing.stopAttention(id);
105-
}
104+
// Always stop attention for any notification type
105+
attentionDrawing.stopAttention(id);
106+
106107
notificationTypes.delete(id);
107108
notificationCategories.delete(id);
108109
});
@@ -243,13 +244,12 @@ export const setupNotifications = (): void => {
243244

244245
listen(NOTIFICATIONS_NOTIFICATION_DISMISSED, (action) => {
245246
const notificationId = String(action.payload.id);
246-
const notificationType = notificationTypes.get(notificationId);
247247

248248
notifications.get(notificationId)?.close();
249249

250-
if (notificationType === 'voice') {
251-
attentionDrawing.stopAttention(notificationId);
252-
}
250+
// stopAttention is safe and idempotent
251+
attentionDrawing.stopAttention(notificationId);
252+
253253
notificationTypes.delete(notificationId);
254254
});
255255
};

0 commit comments

Comments
 (0)