Added logout in loading screen
authorAjay Bura <ajbura@gmail.com>
Wed, 27 Oct 2021 11:38:26 +0000 (17:08 +0530)
committerAjay Bura <ajbura@gmail.com>
Wed, 27 Oct 2021 11:38:26 +0000 (17:08 +0530)
Signed-off-by: Ajay Bura <ajbura@gmail.com>
src/app/templates/client/Client.jsx
src/app/templates/client/Client.scss
src/client/action/logout.js

index bf7a3e77ddd94d08065d8bf4ddb927915240e798..145aaca2a0176b400791e60e9277860c3d70518b 100644 (file)
@@ -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>
 
index 05280985b843c8090ec06cbde766f5a861464703..a94312c38c764a7cd98d86b9570535729fe8d057 100644 (file)
 .loading__appname {
   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);
+  }
 }
\ No newline at end of file
index f9386995af0e32e5d25379b2dae60240b41e5249..3c7b84864804b8a9bb5aa9ddd28fbcaa68f27a98 100644 (file)
@@ -2,6 +2,7 @@ import initMatrix from '../initMatrix';
 
 function logout() {
   const mx = initMatrix.matrixClient;
+  mx.stopClient();
   mx.logout().then(() => {
     mx.clearStores();
     window.localStorage.clear();