mattermost-mobile/app/actions/views/root.js
enahum 81526fbb09 Channel drawer (#154)
* Channel list drawer
* Get channels by category
* Fix and connect websocket
* Fix Select first team using the team members

* create loadMe and fix login actions to loads the teams

* Add android back button handler for the channel drawer

* Channel drawer styling and functionality

* Mark channel as viewed and fixed reset unread counts

* Unread above/below indicators

* Improve performance replacing ScrollView with ListView

* Fix unread indicators

* Addressing review feedback
2017-01-03 19:49:28 -03:00

32 lines
811 B
JavaScript

// Copyright (c) 2016 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
import {NavigationTypes} from 'app/constants';
import Routes from 'app/navigation/routes';
import Client from 'service/client';
import {loadMe} from 'service/actions/users';
export function goToSelectServer() {
return async (dispatch, getState) => {
dispatch({
type: NavigationTypes.NAVIGATION_RESET,
routes: [Routes.SelectServer],
index: 0
}, getState);
};
}
export function setStoreFromLocalData(data) {
return async (dispatch, getState) => {
Client.setToken(data.token);
Client.setUrl(data.url);
return loadMe()(dispatch, getState);
};
}
export default {
goToSelectServer,
setStoreFromLocalData
};