From c1823e2e5ae46996b169842cbe7876e10254cc9d Mon Sep 17 00:00:00 2001 From: dangwynne <31453528+dangwynne@users.noreply.github.com> Date: Wed, 3 Feb 2021 22:31:28 +0000 Subject: [PATCH 1/3] Close current modal when session is logged out --- src/components/structures/MatrixChat.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/components/structures/MatrixChat.tsx b/src/components/structures/MatrixChat.tsx index 8ed4b6cd11..ce5467ec89 100644 --- a/src/components/structures/MatrixChat.tsx +++ b/src/components/structures/MatrixChat.tsx @@ -1378,11 +1378,14 @@ export default class MatrixChat extends React.PureComponent { 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.'), }); + dis.dispatch({ action: 'logout', }); From 88aa2a6f70e87fb1e218fd24b3c5e7530e421ceb Mon Sep 17 00:00:00 2001 From: dangwynne Date: Thu, 4 Feb 2021 09:33:21 +0000 Subject: [PATCH 2/3] fix whitespace change. Signed-off-by: Dan Gwynne dangwynne1@gmail.com --- src/components/structures/MatrixChat.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/structures/MatrixChat.tsx b/src/components/structures/MatrixChat.tsx index ce5467ec89..5d938317cb 100644 --- a/src/components/structures/MatrixChat.tsx +++ b/src/components/structures/MatrixChat.tsx @@ -1378,14 +1378,14 @@ export default class MatrixChat extends React.PureComponent { 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.'), }); - + dis.dispatch({ action: 'logout', }); From 12f6272ab47887f187f810378c06b51b35956abe Mon Sep 17 00:00:00 2001 From: dangwynne Date: Fri, 5 Feb 2021 09:24:12 +0000 Subject: [PATCH 3/3] implement qa feedback for closing modals when logging out --- src/components/structures/MatrixChat.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/structures/MatrixChat.tsx b/src/components/structures/MatrixChat.tsx index 5d938317cb..2f5500e054 100644 --- a/src/components/structures/MatrixChat.tsx +++ b/src/components/structures/MatrixChat.tsx @@ -1373,14 +1373,15 @@ export default class MatrixChat extends React.PureComponent { 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.'),