feat(notifications): honor chat mute in web realtime alerts
Some checks failed
CI / test (push) Failing after 1m30s
Some checks failed
CI / test (push) Failing after 1m30s
This commit is contained in:
@@ -15,6 +15,7 @@ export interface Chat {
|
||||
is_saved?: boolean;
|
||||
archived?: boolean;
|
||||
pinned?: boolean;
|
||||
muted?: boolean;
|
||||
unread_count?: number;
|
||||
unread_mentions_count?: number;
|
||||
pinned_message_id?: number | null;
|
||||
|
||||
@@ -433,6 +433,9 @@ function maybeShowBrowserNotification(
|
||||
}
|
||||
const chat = useChatStore.getState().chats.find((item) => item.id === chatId);
|
||||
const isMention = hasMentionForUser(message.text, currentUsername);
|
||||
if (!isMention && chat?.muted) {
|
||||
return;
|
||||
}
|
||||
if (!isMention && chat?.type === "private" && !prefs.privateNotifications) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user