implement qa feedback for closing modals when logging out

This commit is contained in:
dangwynne 2021-02-05 09:24:12 +00:00
parent 88aa2a6f70
commit 12f6272ab4

View file

@ -1373,14 +1373,15 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
cli.on('Session.logged_out', function(errObj) {
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']) {
console.warn("Soft logout issued by server - avoiding data deletion");
Lifecycle.softLogout();
return;
}
Modal.closeCurrentModal("User has been logged out.");
Modal.createTrackedDialog('Signed out', '', ErrorDialog, {
title: _t('Signed Out'),
description: _t('For security, this session has been signed out. Please sign in again.'),