diff --git a/app/screens/channel/channel_post_list/intro/public_or_private_channel/index.ts b/app/screens/channel/channel_post_list/intro/public_or_private_channel/index.ts index afe46e31e9..086bb257f3 100644 --- a/app/screens/channel/channel_post_list/intro/public_or_private_channel/index.ts +++ b/app/screens/channel/channel_post_list/intro/public_or_private_channel/index.ts @@ -10,14 +10,13 @@ import {Preferences} from '@constants'; import {getTeammateNameDisplaySetting} from '@helpers/api/preference'; import {queryPreferencesByCategoryAndName} from '@queries/servers/preference'; import {observeConfig, observeLicense} from '@queries/servers/system'; -import {observeCurrentUser} from '@queries/servers/user'; +import {observeCurrentUser, observeUser} from '@queries/servers/user'; import {displayUsername} from '@utils/user'; import PublicOrPrivateChannel from './public_or_private_channel'; import type {WithDatabaseArgs} from '@typings/database/database'; import type ChannelModel from '@typings/database/models/servers/channel'; -import type UserModel from '@typings/database/models/servers/user'; const enhanced = withObservables([], ({channel, database}: {channel: ChannelModel} & WithDatabaseArgs) => { let creator; @@ -26,13 +25,14 @@ const enhanced = withObservables([], ({channel, database}: {channel: ChannelMode const license = observeLicense(database); const preferences = queryPreferencesByCategoryAndName(database, Preferences.CATEGORY_DISPLAY_SETTINGS).observe(); const me = observeCurrentUser(database); + const profile = observeUser(database, channel.creatorId); - const profile = channel.creator.observe(); const teammateNameDisplay = combineLatest([preferences, config, license]).pipe( map(([prefs, cfg, lcs]) => getTeammateNameDisplaySetting(prefs, cfg, lcs)), ); + creator = combineLatest([profile, teammateNameDisplay, me]).pipe( - map(([user, displaySetting, currentUser]) => (user ? displayUsername(user as UserModel, currentUser?.locale, displaySetting, true) : '')), + map(([user, displaySetting, currentUser]) => (user ? displayUsername(user, currentUser?.locale, displaySetting, true) : '')), ); } else { creator = of$(undefined); diff --git a/package-lock.json b/package-lock.json index 7802e4298b..5bdcc4a994 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,6 +5,7 @@ "requires": true, "packages": { "": { + "name": "mattermost-mobile", "version": "2.0.0", "hasInstallScript": true, "license": "Apache 2.0",