mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-17 21:15:32 +09:00
fix(app): stop muted channels from marking the guild unread (#1644)
This commit is contained in:
1 parent
0692aa0e25
commit
2dc9ded0e8
1 file changed
+2
@@ -12,6 +12,7 @@ import AdvancedSettings from '@app/features/user/state/AdvancedSettings';
|
|||||||
import UserGuildSettings from '@app/features/user/state/UserGuildSettings';
|
import UserGuildSettings from '@app/features/user/state/UserGuildSettings';
|
||||||
import {ME} from '@fluxer/constants/src/AppConstants';
|
import {ME} from '@fluxer/constants/src/AppConstants';
|
||||||
import {GUILD_TEXT_BASED_CHANNEL_TYPES} from '@fluxer/constants/src/ChannelConstants';
|
import {GUILD_TEXT_BASED_CHANNEL_TYPES} from '@fluxer/constants/src/ChannelConstants';
|
||||||
|
import {MessageNotifications} from '@fluxer/constants/src/NotificationConstants';
|
||||||
import type {ChannelId, GuildId} from '@fluxer/schema/src/branded/WireIds';
|
import type {ChannelId, GuildId} from '@fluxer/schema/src/branded/WireIds';
|
||||||
import {makeAutoObservable, observable, reaction, runInAction} from 'mobx';
|
import {makeAutoObservable, observable, reaction, runInAction} from 'mobx';
|
||||||
|
|
||||||
@@ -52,6 +53,7 @@ function isChannelMutedForUnread(channel: ContributeChannel): boolean {
|
|||||||
|
|
||||||
function resolveUnreadBadgesLevel(channel: ContributeChannel): number | null {
|
function resolveUnreadBadgesLevel(channel: ContributeChannel): number | null {
|
||||||
if (channel.isPrivate()) return null;
|
if (channel.isPrivate()) return null;
|
||||||
|
if (isChannelMutedForUnread(channel)) return MessageNotifications.NO_MESSAGES;
|
||||||
return UserGuildSettings.resolvedGuildUnreadBadgesLevel({
|
return UserGuildSettings.resolvedGuildUnreadBadgesLevel({
|
||||||
id: channel.id,
|
id: channel.id,
|
||||||
guildId: channel.guildId ?? undefined,
|
guildId: channel.guildId ?? undefined,
|
||||||
|
|||||||
Reference in new issue
Block a user