diff options
Diffstat (limited to 'webapp/utils/utils.jsx')
-rw-r--r-- | webapp/utils/utils.jsx | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/webapp/utils/utils.jsx b/webapp/utils/utils.jsx index 83519a6ec..b248368fc 100644 --- a/webapp/utils/utils.jsx +++ b/webapp/utils/utils.jsx @@ -795,6 +795,10 @@ export function applyTheme(theme) { updateCodeTheme(theme.codeTheme); } +export function resetTheme() { + applyTheme(Constants.THEMES.default); +} + export function applyFont(fontName) { const body = $('body'); @@ -1255,12 +1259,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); |