implement qa feedback for closing modals when logging out

pull/21833/head
dangwynne 2021-02-05 09:24:12 +00:00
parent 88aa2a6f70
commit 12f6272ab4
1 changed files with 3 additions and 2 deletions

View File

@ -1373,14 +1373,15 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
cli.on('Session.logged_out', function(errObj) { cli.on('Session.logged_out', function(errObj) {
if (Lifecycle.isLoggingOut()) return; if (Lifecycle.isLoggingOut()) return;
// A modal might have been open when we were logged out by the server
Modal.closeCurrentModal('Session.logged_out');
if (errObj.httpStatus === 401 && errObj.data && errObj.data['soft_logout']) { if (errObj.httpStatus === 401 && errObj.data && errObj.data['soft_logout']) {
console.warn("Soft logout issued by server - avoiding data deletion"); console.warn("Soft logout issued by server - avoiding data deletion");
Lifecycle.softLogout(); Lifecycle.softLogout();
return; return;
} }
Modal.closeCurrentModal("User has been logged out.");
Modal.createTrackedDialog('Signed out', '', ErrorDialog, { Modal.createTrackedDialog('Signed out', '', ErrorDialog, {
title: _t('Signed Out'), title: _t('Signed Out'),
description: _t('For security, this session has been signed out. Please sign in again.'), description: _t('For security, this session has been signed out. Please sign in again.'),