From 33eebb84a6c718d2fc14962dc467c01498a278ab Mon Sep 17 00:00:00 2001 From: Germain Souquet Date: Mon, 19 Apr 2021 17:57:20 +0100 Subject: [PATCH] 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); } }