diff options
Diffstat (limited to 'webapp/actions')
-rw-r--r-- | webapp/actions/channel_actions.jsx | 11 | ||||
-rw-r--r-- | webapp/actions/global_actions.jsx | 8 |
2 files changed, 10 insertions, 9 deletions
diff --git a/webapp/actions/channel_actions.jsx b/webapp/actions/channel_actions.jsx index 6e529d332..39dc37591 100644 --- a/webapp/actions/channel_actions.jsx +++ b/webapp/actions/channel_actions.jsx @@ -181,14 +181,13 @@ export function openDirectChannelToUser(userId, success, error) { export function openGroupChannelToUsers(userIds, success, error) { ChannelActions.createGroupChannel(userIds)(dispatch, getState).then( - (data) => { + (result) => { loadProfilesForSidebar(); - if (data && success) { - success(data, false); - } else if (data == null && error) { + if (result.data && success) { + success(result.data, false); + } else if (result.error && error) { browserHistory.push(TeamStore.getCurrentTeamUrl()); - const serverError = getState().requests.channels.createChannel.error; - error({id: serverError.server_error_id, ...serverError}); + error({id: result.error.server_error_id, ...result.error}); } } ); diff --git a/webapp/actions/global_actions.jsx b/webapp/actions/global_actions.jsx index b3dc078c4..2b65beffd 100644 --- a/webapp/actions/global_actions.jsx +++ b/webapp/actions/global_actions.jsx @@ -45,9 +45,11 @@ export function emitChannelClickEvent(channel) { const currentUserId = UserStore.getCurrentId(); const otherUserId = Utils.getUserIdFromChannelName(chan); createDirectChannel(currentUserId, otherUserId)(dispatch, getState).then( - (data) => { - if (data) { - success(data); + (result) => { + const receivedChannel = result.data; + + if (receivedChannel) { + success(receivedChannel); } else { fail(); } |