From 33eebb84a6c718d2fc14962dc467c01498a278ab Mon Sep 17 00:00:00 2001 From: Germain Souquet Date: Mon, 19 Apr 2021 17:57:20 +0100 Subject: [PATCH 1/2] Ensure PersistedElement are unmounted on application logout --- src/components/structures/MatrixChat.tsx | 1 + src/components/views/elements/PersistedElement.js | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/components/structures/MatrixChat.tsx b/src/components/structures/MatrixChat.tsx index d9ed7d061b..b8e591943b 100644 --- a/src/components/structures/MatrixChat.tsx +++ b/src/components/structures/MatrixChat.tsx @@ -586,6 +586,7 @@ export default class MatrixChat extends React.PureComponent { break; case 'logout': dis.dispatch({action: "hangup_all"}); + dis.dispatch({action: "logout"}); Lifecycle.logout(); break; case 'require_registration': diff --git a/src/components/views/elements/PersistedElement.js b/src/components/views/elements/PersistedElement.js index f504b3e97f..701c140a19 100644 --- a/src/components/views/elements/PersistedElement.js +++ b/src/components/views/elements/PersistedElement.js @@ -139,6 +139,8 @@ export default class PersistedElement extends React.Component { _onAction(payload) { if (payload.action === 'timeline_resize') { this._repositionChild(); + } else if (payload.action === 'logout') { + PersistedElement.destroyElement(this.props.persistKey); } } From a3617fa3cdc0545e94421d73d0d108e64ab3e007 Mon Sep 17 00:00:00 2001 From: Germain Souquet Date: Tue, 20 Apr 2021 08:51:14 +0100 Subject: [PATCH 2/2] Remove unnecessary logout action --- src/components/structures/MatrixChat.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/structures/MatrixChat.tsx b/src/components/structures/MatrixChat.tsx index b8e591943b..d9ed7d061b 100644 --- a/src/components/structures/MatrixChat.tsx +++ b/src/components/structures/MatrixChat.tsx @@ -586,7 +586,6 @@ export default class MatrixChat extends React.PureComponent { break; case 'logout': dis.dispatch({action: "hangup_all"}); - dis.dispatch({action: "logout"}); Lifecycle.logout(); break; case 'require_registration':