diff options
author | Harrison Healey <harrisonmhealey@gmail.com> | 2016-03-30 09:55:32 -0400 |
---|---|---|
committer | Harrison Healey <harrisonmhealey@gmail.com> | 2016-03-30 09:55:32 -0400 |
commit | 55f3ae576d47245dcc8393b0ffbefb38eba65645 (patch) | |
tree | 39959d83d1687309e5e8f775ee6f770832ca0477 /webapp/utils | |
parent | 2e9f5c7cf052cea3db10ec200a6736e6cbc880a3 (diff) | |
download | chat-55f3ae576d47245dcc8393b0ffbefb38eba65645.tar.gz chat-55f3ae576d47245dcc8393b0ffbefb38eba65645.tar.bz2 chat-55f3ae576d47245dcc8393b0ffbefb38eba65645.zip |
Fixed adding direct channels to the sidebar
Diffstat (limited to 'webapp/utils')
-rw-r--r-- | webapp/utils/utils.jsx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/webapp/utils/utils.jsx b/webapp/utils/utils.jsx index 83519a6ec..99765cae2 100644 --- a/webapp/utils/utils.jsx +++ b/webapp/utils/utils.jsx @@ -1255,12 +1255,15 @@ export function windowHeight() { } export function openDirectChannelToUser(user, successCb, errorCb) { + AsyncClient.savePreference( + Constants.Preferences.CATEGORY_DIRECT_CHANNEL_SHOW, + user.id, + 'true' + ); + const channelName = this.getDirectChannelName(UserStore.getCurrentId(), user.id); let channel = ChannelStore.getByName(channelName); - const preference = PreferenceStore.setPreference(Constants.Preferences.CATEGORY_DIRECT_CHANNEL_SHOW, user.id, 'true'); - AsyncClient.savePreferences([preference]); - if (channel) { if ($.isFunction(successCb)) { successCb(channel, true); |