channel settings can be null or undefined

This commit is contained in:
Elias Nahum
2022-03-23 12:00:34 -03:00
parent 292d72dc79
commit 296d088ca2

View File

@@ -15,7 +15,6 @@ import ChannelListItem from './channel_list_item';
import type {WithDatabaseArgs} from '@typings/database/database';
import type ChannelModel from '@typings/database/models/servers/channel';
import type MyChannelSettingsModel from '@typings/database/models/servers/my_channel_settings';
const enhance = withObservables(['channelId'], ({channelId, database}: {channelId: string} & WithDatabaseArgs) => {
const myChannel = observeMyChannel(database, channelId);
@@ -37,7 +36,7 @@ const enhance = withObservables(['channelId'], ({channelId, database}: {channelI
return {
isOwnDirectMessage,
isMuted: settings.pipe(
switchMap((s: MyChannelSettingsModel) => of$(s.notifyProps?.mark_unread === 'mention')),
switchMap((s) => of$(s?.notifyProps?.mark_unread === 'mention')),
),
myChannel,
channel: channel.pipe(