diff --git a/webapp/channels/src/packages/mattermost-redux/src/actions/channels.ts b/webapp/channels/src/packages/mattermost-redux/src/actions/channels.ts index 72ddd3780c..44255dc306 100644 --- a/webapp/channels/src/packages/mattermost-redux/src/actions/channels.ts +++ b/webapp/channels/src/packages/mattermost-redux/src/actions/channels.ts @@ -271,11 +271,11 @@ export function updateChannelPrivacy(channelId: string, privacy: string): Action }); } -export function convertGroupMessageToPrivateChannel(channelID: string, teamID: string, displayName: string, name: string): ActionFuncAsync { +export function convertGroupMessageToPrivateChannel(channelID: string, teamID: string, displayName: string, name: string): ActionFuncAsync { return async (dispatch, getState) => { - let updatedChannel; + let response; try { - updatedChannel = await Client4.convertGroupMessageToPrivateChannel(channelID, teamID, displayName, name); + response = await Client4.convertGroupMessageToPrivateChannel(channelID, teamID, displayName, name); } catch (error) { forceLogoutIfNecessary(error, dispatch, getState); dispatch(logError(error)); @@ -284,7 +284,7 @@ export function convertGroupMessageToPrivateChannel(channelID: string, teamID: s dispatch({ type: ChannelTypes.RECEIVED_CHANNEL, - data: updatedChannel, + data: response.data, }); // move the channel from direct message category to the default "channels" category @@ -293,7 +293,9 @@ export function convertGroupMessageToPrivateChannel(channelID: string, teamID: s return {}; } - return updatedChannel; + return { + data: response.data, + }; }; }