Fixes channel muting inside category (#6267)

This commit is contained in:
Shaz MJ 2022-05-13 12:53:24 +10:00 committed by GitHub
parent b3f3ea5975
commit 8ca26bde7d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 4 deletions

View file

@ -21,12 +21,11 @@ import type {WithDatabaseArgs} from '@typings/database/database';
type EnhanceProps = WithDatabaseArgs & {
channel: ChannelModel;
showTeamName?: boolean;
isCategoryMuted?: boolean;
}
const observeIsMutedSetting = (mc: MyChannelModel) => mc.settings.observe().pipe(switchMap((s) => of$(s?.notifyProps?.mark_unread === 'mention')));
const enhance = withObservables(['channel', 'showTeamName', 'isCategoryMuted'], ({channel, database, showTeamName, isCategoryMuted}: EnhanceProps) => {
const enhance = withObservables(['channel', 'showTeamName'], ({channel, database, showTeamName}: EnhanceProps) => {
const currentUserId = observeCurrentUserId(database);
const myChannel = observeMyChannel(database, channel.id);
@ -47,7 +46,6 @@ const enhance = withObservables(['channel', 'showTeamName', 'isCategoryMuted'],
}
return observeIsMutedSetting(mc);
}),
switchMap((muted) => of$(isCategoryMuted || muted)),
);
let teamDisplayName = of$('');

View file

@ -43,7 +43,6 @@ const CategoryBody = ({sortedChannels, category, hiddenChannelIds, limit, onChan
channel={item}
testID={`category.${category.displayName.replace(/ /g, '_').toLocaleLowerCase()}.channel_list_item`}
onPress={onChannelSwitch}
isCategoryMuted={category.muted}
key={item.id}
/>
);