From c43656496e8655cccfda63f14534254749ac5d1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Espino=20Garc=C3=ADa?= Date: Tue, 20 Feb 2024 17:16:07 +0100 Subject: [PATCH] Fix issue when opening a avatar image from a thread (#7824) * Fix issue when opening a avatar image from a thread * Remove unneeded casting --------- Co-authored-by: Mattermost Build --- app/screens/gallery/footer/index.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/screens/gallery/footer/index.ts b/app/screens/gallery/footer/index.ts index 050d8eda9..dc37a206e 100644 --- a/app/screens/gallery/footer/index.ts +++ b/app/screens/gallery/footer/index.ts @@ -14,7 +14,6 @@ import {observeTeammateNameDisplay, observeUser} from '@queries/servers/user'; import Footer from './footer'; import type {WithDatabaseArgs} from '@typings/database/database'; -import type ChannelModel from '@typings/database/models/servers/channel'; import type {GalleryItemType} from '@typings/screens/gallery'; type FooterProps = WithDatabaseArgs & { @@ -48,8 +47,8 @@ const enhanced = withObservables(['item'], ({database, item}: FooterProps) => { const enablePostUsernameOverride = observeConfigBooleanValue(database, 'EnablePostUsernameOverride'); const enablePostIconOverride = observeConfigBooleanValue(database, 'EnablePostIconOverride'); const enablePublicLink = observeConfigBooleanValue(database, 'EnablePublicLink'); - const channelName = channel.pipe(switchMap((c: ChannelModel) => of$(c.displayName))); - const isDirectChannel = channel.pipe(switchMap((c: ChannelModel) => of$(c.type === General.DM_CHANNEL))); + const channelName = channel.pipe(switchMap((c) => of$(c?.displayName || ''))); + const isDirectChannel = channel.pipe(switchMap((c) => of$(c?.type === General.DM_CHANNEL))); return { author,