From b19ce98a74fda9f23453b7bb78f6fa800be0c8ac Mon Sep 17 00:00:00 2001 From: Scott Bishel Date: Thu, 17 Apr 2025 09:59:33 -0600 Subject: [PATCH] get custom profile fields after login (#30665) Co-authored-by: Mattermost Build --- .../src/packages/mattermost-redux/src/actions/users.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/webapp/channels/src/packages/mattermost-redux/src/actions/users.ts b/webapp/channels/src/packages/mattermost-redux/src/actions/users.ts index ff8fe1a23f..014ed28f53 100644 --- a/webapp/channels/src/packages/mattermost-redux/src/actions/users.ts +++ b/webapp/channels/src/packages/mattermost-redux/src/actions/users.ts @@ -11,7 +11,7 @@ import type {UserProfile, UserStatus, GetFilteredUsersStatsOpts, UsersStats, Use import {UserTypes, AdminTypes} from 'mattermost-redux/action_types'; import {logError} from 'mattermost-redux/actions/errors'; -import {setServerVersion, getClientConfig, getLicenseConfig} from 'mattermost-redux/actions/general'; +import {setServerVersion, getClientConfig, getLicenseConfig, getCustomProfileAttributeFields} from 'mattermost-redux/actions/general'; import {bindClientFunc, forceLogoutIfNecessary} from 'mattermost-redux/actions/helpers'; import {getServerLimits} from 'mattermost-redux/actions/limits'; import {getMyPreferences} from 'mattermost-redux/actions/preferences'; @@ -20,7 +20,7 @@ import {getMyTeams, getMyTeamMembers, getMyTeamUnreads} from 'mattermost-redux/a import {Client4} from 'mattermost-redux/client'; import {General} from 'mattermost-redux/constants'; import {getIsUserStatusesConfigEnabled} from 'mattermost-redux/selectors/entities/common'; -import {getServerVersion} from 'mattermost-redux/selectors/entities/general'; +import {getServerVersion, getFeatureFlagValue} from 'mattermost-redux/selectors/entities/general'; import {isCollapsedThreadsEnabled} from 'mattermost-redux/selectors/entities/preferences'; import {getCurrentUserId, getUser as selectUser, getUsers, getUsersByUsername} from 'mattermost-redux/selectors/entities/users'; import type {ActionFuncAsync} from 'mattermost-redux/types/actions'; @@ -81,6 +81,10 @@ export function loadMe(): ActionFuncAsync { dispatch(getMyTeamMembers()), ]); + if (getFeatureFlagValue(getState(), 'CustomProfileAttributes') === 'true') { + dispatch(getCustomProfileAttributeFields()); + } + const isCollapsedThreads = isCollapsedThreadsEnabled(getState()); await dispatch(getMyTeamUnreads(isCollapsedThreads));