summaryrefslogtreecommitdiffstats
path: root/webapp/actions
diff options
context:
space:
mode:
authorCarlos Tadeu Panato Junior <ctadeu@gmail.com>2016-12-01 15:04:33 +0100
committerJoram Wilander <jwawilander@gmail.com>2016-12-01 09:04:33 -0500
commit8c18da21f3e51421a0dc6fbd4be1fa1e838dd482 (patch)
tree8f6ed00558fbf63dedb8d1effa1f52c4a3c3e97d /webapp/actions
parentf013d91b89c03e49e66d0726cb66be886bc80c01 (diff)
downloadchat-8c18da21f3e51421a0dc6fbd4be1fa1e838dd482.tar.gz
chat-8c18da21f3e51421a0dc6fbd4be1fa1e838dd482.tar.bz2
chat-8c18da21f3e51421a0dc6fbd4be1fa1e838dd482.zip
Move instances of Client.updateChannel() in components to an action (#4643)
* Move instances of Client.updateChannel() in components to an action * update per code review
Diffstat (limited to 'webapp/actions')
-rw-r--r--webapp/actions/channel_actions.jsx18
1 files changed, 18 insertions, 0 deletions
diff --git a/webapp/actions/channel_actions.jsx b/webapp/actions/channel_actions.jsx
index ae32a481b..b108633d7 100644
--- a/webapp/actions/channel_actions.jsx
+++ b/webapp/actions/channel_actions.jsx
@@ -210,6 +210,24 @@ export function joinChannel(channel, success, error) {
);
}
+export function updateChannel(channel, success, error) {
+ Client.updateChannel(
+ channel,
+ () => {
+ AsyncClient.getChannel(channel.id);
+
+ if (success) {
+ success();
+ }
+ },
+ (err) => {
+ if (error) {
+ error(err);
+ }
+ }
+ );
+}
+
export function searchMoreChannels(term, success, error) {
Client.searchMoreChannels(
term,