summaryrefslogtreecommitdiffstats
path: root/web/react/components/user_settings/manage_outgoing_hooks.jsx
diff options
context:
space:
mode:
authorJoramWilander <jwawilander@gmail.com>2015-10-02 08:14:31 -0400
committerJoramWilander <jwawilander@gmail.com>2015-10-19 09:00:30 -0400
commit5574151c8581211326b9ae4dbb400e70b083ecb9 (patch)
tree6b3a98c2e509594438ce0edd74312f6330382fc1 /web/react/components/user_settings/manage_outgoing_hooks.jsx
parentba3cde024fecbc5c7cf3fee2348fb7db66da2160 (diff)
downloadchat-5574151c8581211326b9ae4dbb400e70b083ecb9.tar.gz
chat-5574151c8581211326b9ae4dbb400e70b083ecb9.tar.bz2
chat-5574151c8581211326b9ae4dbb400e70b083ecb9.zip
Fix postgres query and minor UI updates for outgoing webhooks.
Diffstat (limited to 'web/react/components/user_settings/manage_outgoing_hooks.jsx')
-rw-r--r--web/react/components/user_settings/manage_outgoing_hooks.jsx13
1 files changed, 4 insertions, 9 deletions
diff --git a/web/react/components/user_settings/manage_outgoing_hooks.jsx b/web/react/components/user_settings/manage_outgoing_hooks.jsx
index d8272610d..e83ae3bd6 100644
--- a/web/react/components/user_settings/manage_outgoing_hooks.jsx
+++ b/web/react/components/user_settings/manage_outgoing_hooks.jsx
@@ -39,12 +39,12 @@ export default class ManageOutgoingHooks extends React.Component {
Client.addOutgoingHook(
hook,
(data) => {
- let hooks = this.state.hooks;
+ let hooks = Object.assign([], this.state.hooks);
if (!hooks) {
hooks = [];
}
hooks.push(data);
- this.setState({hooks, serverError: null});
+ this.setState({hooks, serverError: null, channelId: '', triggerWords: '', callbackURLs: ''});
},
(err) => {
this.setState({serverError: err});
@@ -93,7 +93,7 @@ export default class ManageOutgoingHooks extends React.Component {
}
}
- this.setState({hooks});
+ this.setState({hooks, serverError: null});
},
(err) => {
this.setState({serverError: err});
@@ -103,14 +103,9 @@ export default class ManageOutgoingHooks extends React.Component {
getHooks() {
Client.listOutgoingHooks(
(data) => {
- const state = this.state;
-
if (data) {
- state.hooks = data;
+ this.setState({hooks: data, getHooksComplete: true, serverError: null});
}
-
- state.getHooksComplete = true;
- this.setState(state);
},
(err) => {
this.setState({serverError: err});