Added logout in loading screen
Signed-off-by: Ajay Bura <ajbura@gmail.com>
This commit is contained in:
parent
8fb9365eaa
commit
1fa1496d7f
3 changed files with 14 additions and 0 deletions
|
@ -9,6 +9,7 @@ import Windows from '../../organisms/pw/Windows';
|
|||
import Dialogs from '../../organisms/pw/Dialogs';
|
||||
import EmojiBoardOpener from '../../organisms/emoji-board/EmojiBoardOpener';
|
||||
import RoomOptions from '../../organisms/room-optons/RoomOptions';
|
||||
import logout from '../../../client/action/logout';
|
||||
|
||||
import initMatrix from '../../../client/initMatrix';
|
||||
|
||||
|
@ -25,6 +26,9 @@ function Client() {
|
|||
if (isLoading) {
|
||||
return (
|
||||
<div className="loading-display">
|
||||
<button className="loading__logout" onClick={logout} type="button">
|
||||
<Text variant="b3">Logout</Text>
|
||||
</button>
|
||||
<Spinner />
|
||||
<Text className="loading__message" variant="b2">Heating up</Text>
|
||||
|
||||
|
|
|
@ -32,3 +32,12 @@
|
|||
position: absolute;
|
||||
bottom: var(--sp-normal);
|
||||
}
|
||||
.loading__logout {
|
||||
position: absolute;
|
||||
bottom: var(--sp-extra-tight);
|
||||
right: var(--sp-extra-tight);
|
||||
cursor: pointer;
|
||||
.text {
|
||||
color: var(--tc-link);
|
||||
}
|
||||
}
|
|
@ -2,6 +2,7 @@ import initMatrix from '../initMatrix';
|
|||
|
||||
function logout() {
|
||||
const mx = initMatrix.matrixClient;
|
||||
mx.stopClient();
|
||||
mx.logout().then(() => {
|
||||
mx.clearStores();
|
||||
window.localStorage.clear();
|
||||
|
|
Loading…
Reference in a new issue