Clean up /logout command flow and errors (#4918)
Этот коммит содержится в:
коммит произвёл
Christopher Speller
родитель
28a7a2f200
Коммит
2a91e5e031
@@ -476,15 +476,7 @@ export function emitUserLoggedOutEvent(redirectTo = '/', shouldSignalLogout = tr
|
||||
BrowserStore.signalLogout();
|
||||
}
|
||||
|
||||
BrowserStore.clear();
|
||||
ErrorStore.clearLastError();
|
||||
PreferenceStore.clear();
|
||||
UserStore.clear();
|
||||
TeamStore.clear();
|
||||
newLocalizationSelected(global.window.mm_config.DefaultClientLocale);
|
||||
stopPeriodicStatusUpdates();
|
||||
WebsocketActions.close();
|
||||
browserHistory.push(redirectTo);
|
||||
clientLogout(redirectTo);
|
||||
},
|
||||
() => {
|
||||
browserHistory.push(redirectTo);
|
||||
@@ -492,6 +484,18 @@ export function emitUserLoggedOutEvent(redirectTo = '/', shouldSignalLogout = tr
|
||||
);
|
||||
}
|
||||
|
||||
export function clientLogout(redirectTo = '/') {
|
||||
BrowserStore.clear();
|
||||
ErrorStore.clearLastError();
|
||||
PreferenceStore.clear();
|
||||
UserStore.clear();
|
||||
TeamStore.clear();
|
||||
newLocalizationSelected(global.window.mm_config.DefaultClientLocale);
|
||||
stopPeriodicStatusUpdates();
|
||||
WebsocketActions.close();
|
||||
browserHistory.push(redirectTo);
|
||||
}
|
||||
|
||||
export function emitSearchMentionsEvent(user) {
|
||||
let terms = '';
|
||||
if (user.notify_props && user.notify_props.mention_keys) {
|
||||
|
||||
Ссылка в новой задаче
Block a user