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 <build@mattermost.com>
This commit is contained in:
Daniel Espino García 2024-02-20 17:16:07 +01:00 committed by GitHub
parent 9b7a1d38f2
commit c43656496e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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,