Move instances of Client.deleteChannel() in components to an action (#5164)

This commit is contained in:
Carlos Tadeu Panato Junior
2017-01-23 15:22:26 +01:00
committed by Joram Wilander
parent a8f35c5738
commit dbfd93daa7
2 changed files with 22 additions and 12 deletions

View File

@@ -461,3 +461,23 @@ export function leaveChannel(channelId, success, error) {
}
);
}
export function deleteChannel(channelId, success, error) {
Client.deleteChannel(
channelId,
() => {
loadChannelsForCurrentUser();
if (success) {
success();
}
},
(err) => {
AsyncClient.dispatchError(err, 'handleDelete');
if (error) {
error(err);
}
}
);
}