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 Dialogs from '../../organisms/pw/Dialogs';
|
||||||
import EmojiBoardOpener from '../../organisms/emoji-board/EmojiBoardOpener';
|
import EmojiBoardOpener from '../../organisms/emoji-board/EmojiBoardOpener';
|
||||||
import RoomOptions from '../../organisms/room-optons/RoomOptions';
|
import RoomOptions from '../../organisms/room-optons/RoomOptions';
|
||||||
|
import logout from '../../../client/action/logout';
|
||||||
|
|
||||||
import initMatrix from '../../../client/initMatrix';
|
import initMatrix from '../../../client/initMatrix';
|
||||||
|
|
||||||
|
@ -25,6 +26,9 @@ function Client() {
|
||||||
if (isLoading) {
|
if (isLoading) {
|
||||||
return (
|
return (
|
||||||
<div className="loading-display">
|
<div className="loading-display">
|
||||||
|
<button className="loading__logout" onClick={logout} type="button">
|
||||||
|
<Text variant="b3">Logout</Text>
|
||||||
|
</button>
|
||||||
<Spinner />
|
<Spinner />
|
||||||
<Text className="loading__message" variant="b2">Heating up</Text>
|
<Text className="loading__message" variant="b2">Heating up</Text>
|
||||||
|
|
||||||
|
|
|
@ -31,4 +31,13 @@
|
||||||
.loading__appname {
|
.loading__appname {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: var(--sp-normal);
|
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() {
|
function logout() {
|
||||||
const mx = initMatrix.matrixClient;
|
const mx = initMatrix.matrixClient;
|
||||||
|
mx.stopClient();
|
||||||
mx.logout().then(() => {
|
mx.logout().then(() => {
|
||||||
mx.clearStores();
|
mx.clearStores();
|
||||||
window.localStorage.clear();
|
window.localStorage.clear();
|
||||||
|
|
Loading…
Reference in a new issue