mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-19 05:55:34 +09:00
feat(app): restyle the inbox and message preview surfaces (#1706)
This commit is contained in:
1 parent
41c7acdd8f
commit
cc105883a5
55 files changed
+10669
-10576
No files matched your search
@@ -0,0 +1,26 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {MessageNotifications} from '@fluxer/constants/src/NotificationConstants';
|
||||
|
||||
export interface UnreadInboxVisibilityInput {
|
||||
unreadBadgesLevel: number | null;
|
||||
isMuted: boolean;
|
||||
hasUnread: boolean;
|
||||
hasMentions: boolean;
|
||||
}
|
||||
|
||||
export function resolveUnreadInboxVisibility(input: UnreadInboxVisibilityInput): boolean {
|
||||
if (!input.hasUnread && !input.hasMentions) {
|
||||
return false;
|
||||
}
|
||||
if (input.unreadBadgesLevel === MessageNotifications.NO_MESSAGES) {
|
||||
return false;
|
||||
}
|
||||
if (input.hasMentions) {
|
||||
return true;
|
||||
}
|
||||
if (input.isMuted) {
|
||||
return false;
|
||||
}
|
||||
return input.unreadBadgesLevel !== MessageNotifications.ONLY_MENTIONS;
|
||||
}
|
||||
Reference in new issue
Block a user