* 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
32 lines
811 B
JavaScript
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
|
|
};
|