diff options
author | Joram Wilander <jwawilander@gmail.com> | 2017-06-26 08:16:57 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-26 08:16:57 -0400 |
commit | 23ccfc845ca2350075f6027e16c6206fc7b71716 (patch) | |
tree | 3fd1f896a5a24b43913be03b21c85638dd7c356e /webapp/components/sidebar.jsx | |
parent | fe7e9d95b30ae2195fcba68db960866db91ce045 (diff) | |
download | chat-23ccfc845ca2350075f6027e16c6206fc7b71716.tar.gz chat-23ccfc845ca2350075f6027e16c6206fc7b71716.tar.bz2 chat-23ccfc845ca2350075f6027e16c6206fc7b71716.zip |
Move remaining actions over to use redux and v4 endpoints (#6720)
Diffstat (limited to 'webapp/components/sidebar.jsx')
-rw-r--r-- | webapp/components/sidebar.jsx | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/webapp/components/sidebar.jsx b/webapp/components/sidebar.jsx index 8b2687e26..040f12c26 100644 --- a/webapp/components/sidebar.jsx +++ b/webapp/components/sidebar.jsx @@ -18,7 +18,6 @@ import PreferenceStore from 'stores/preference_store.jsx'; import ModalStore from 'stores/modal_store.jsx'; import AppDispatcher from 'dispatcher/app_dispatcher.jsx'; -import * as AsyncClient from 'utils/async_client.jsx'; import {sortTeamsByDisplayName} from 'utils/team_utils.jsx'; import * as Utils from 'utils/utils.jsx'; import * as ChannelUtils from 'utils/channel_utils.jsx'; @@ -42,8 +41,12 @@ import favicon from 'images/favicon/favicon-16x16.png'; import redFavicon from 'images/favicon/redfavicon-16x16.png'; import store from 'stores/redux_store.jsx'; +const dispatch = store.dispatch; +const getState = store.getState; + import {getMyPreferences} from 'mattermost-redux/selectors/entities/preferences'; import {getUsers} from 'mattermost-redux/selectors/entities/users'; +import {savePreferences} from 'mattermost-redux/actions/preferences'; export default class Sidebar extends React.Component { constructor(props) { @@ -381,13 +384,8 @@ export default class Sidebar extends React.Component { category = Constants.Preferences.CATEGORY_GROUP_CHANNEL_SHOW; } - AsyncClient.savePreference( - category, - id, - 'false', - () => { - this.isLeaving.set(channel.id, false); - }, + const currentUserId = UserStore.getCurrentId(); + savePreferences(currentUserId, [{user_id: currentUserId, category, name: id, value: 'false'}])(dispatch, getState).then( () => { this.isLeaving.set(channel.id, false); } |