Этот коммит содержится в:
Christopher Speller
2016-11-15 08:06:58 -05:00
родитель 7df8eaf29a 3f19ccf1b1
Коммит e4f46124b0
9 изменённых файлов: 122 добавлений и 54 удалений

Просмотреть файл

@@ -50,13 +50,13 @@ export function emitChannelClickEvent(channel) {
AsyncClient.updateLastViewedAt(chan.id);
loadPosts(chan.id);
trackPage();
});
AppDispatcher.handleViewAction({
type: ActionTypes.CLICK_CHANNEL,
name: chan.name,
id: chan.id,
prev: ChannelStore.getCurrentId()
});
AppDispatcher.handleViewAction({
type: ActionTypes.CLICK_CHANNEL,
name: chan.name,
id: chan.id,
prev: ChannelStore.getCurrentId()
});
}
@@ -461,21 +461,23 @@ export function emitRemoteUserTypingEvent(channelId, userId, postParentId) {
});
}
export function emitUserLoggedOutEvent(redirectTo) {
const rURL = (redirectTo && typeof redirectTo === 'string') ? redirectTo : '/';
export function emitUserLoggedOutEvent(redirectTo = '/', shouldSignalLogout = true) {
Client.logout(
() => {
BrowserStore.signalLogout();
if (shouldSignalLogout) {
BrowserStore.signalLogout();
}
BrowserStore.clear();
ErrorStore.clearLastError();
PreferenceStore.clear();
UserStore.clear();
TeamStore.clear();
newLocalizationSelected(global.window.mm_config.DefaultClientLocale);
browserHistory.push(rURL);
browserHistory.push(redirectTo);
},
() => {
browserHistory.push(rURL);
browserHistory.push(redirectTo);
}
);
}