78
78
<div id =" app" >
79
79
<load-ing :active.sync =" isLoading" :can-cancel =" true" :is-full-page =" true" ></load-ing >
80
80
81
- <b-navbar toggleable =" lg" type =" dark" variant =" white" class =" navStyle" v-if =" showIcon " sticky >
81
+ <b-navbar toggleable =" lg" type =" dark" variant =" white" class =" navStyle" v-if =" getIsLoggedOut " sticky >
82
82
<b-navbar-brand href =" #" >
83
83
<a href =" #" @click =" route('dashboard')" >
84
84
<img src =" ./assets/Entity_full.png" alt =" " style =" height : 5vh ; opacity : 80% " />
107
107
<i class =" fas fa-book-open f-36" style =" color : grey " ></i >
108
108
</b-nav-item >
109
109
110
- <b-nav-item-dropdown right v-if =" showIcon " title =" Profile" >
110
+ <b-nav-item-dropdown right v-if =" getIsLoggedOut " title =" Profile" >
111
111
<template #button-content >
112
112
<i class =" fas fa-user-circle f-36" style =" color : grey " ></i >
113
113
</template >
@@ -300,7 +300,7 @@ import { mapActions, mapMutations, mapGetters, mapState } from "vuex";
300
300
export default {
301
301
computed: {
302
302
... mapGetters (" playgroundStore" , [" userDetails" , " getSelectedOrg" ]),
303
- ... mapGetters (" mainStore" , [" getSelectedService" , " getAllServices" ]),
303
+ ... mapGetters (" mainStore" , [" getSelectedService" , " getAllServices" , ' getIsLoggedOut ' ]),
304
304
... mapState ({
305
305
showMainSideNavBar : (state ) => state .mainStore .showMainSideNavBar ,
306
306
selectedDashboard : (state ) => state .globalStore .selectedDashboard ,
@@ -324,7 +324,6 @@ export default {
324
324
return {
325
325
isLoading: false ,
326
326
collapsed: true ,
327
- showIcon: true ,
328
327
isSidebarCollapsed: true ,
329
328
schema_page: 1 ,
330
329
authRoutes: [" register" , " PKIIdLogin" ],
@@ -336,7 +335,8 @@ export default {
336
335
mounted () {
337
336
this .$root .$on (" clearAppData" , () => {
338
337
this .authToken = null ;
339
- this .showIcon = false ;
338
+ // this.showIcon = false;
339
+ this .setIsLoggedOut (false )
340
340
});
341
341
342
342
this .$root .$on (" recomputeParseAuthTokenEvent" , () => {
@@ -351,7 +351,8 @@ export default {
351
351
if (localStorage .getItem (" user" )) {
352
352
const usrStr = localStorage .getItem (" user" );
353
353
this .user = JSON .parse (usrStr);
354
- this .showIcon = true ;
354
+ // this.showIcon = true;
355
+ this .setIsLoggedOut (true )
355
356
}
356
357
if (localStorage .getItem (" selectedOrg" )) {
357
358
const selectedOrgId = localStorage .getItem (" selectedOrg" );
@@ -372,7 +373,7 @@ export default {
372
373
},
373
374
methods: {
374
375
... mapActions (" mainStore" , [" fetchAppsListFromServer" , " fetchServicesList" ]),
375
- ... mapMutations (" mainStore" , [" resetMainStore" ]),
376
+ ... mapMutations (" mainStore" , [" resetMainStore" , " setIsLoggedOut " ]),
376
377
... mapActions (" playgroundStore" , [
377
378
" insertAschema" ,
378
379
" insertAcredential" ,
@@ -406,9 +407,9 @@ export default {
406
407
return " https://api.dicebear.com/7.x/identicon/svg?seed=" + name;
407
408
},
408
409
logoutAll () {
409
- this .showIcon = false ;
410
+ // this.showIcon = false;
411
+ this .setIsLoggedOut (false )
410
412
if (this .$route .path !== ' /login' ) this .$router .push (' /login' )
411
-
412
413
this .logout ();
413
414
},
414
415
@@ -442,20 +443,13 @@ export default {
442
443
try {
443
444
this .authToken = localStorage .getItem (" authToken" );
444
445
if (this .authToken ) {
445
- this .showIcon = true ;
446
- // this.isLoading = true;
447
- // await this.fetchAppsListFromServer();
448
- // await this.fetchServicesList()
449
-
446
+ this .setIsLoggedOut (true )
450
447
this .$router .push (" dashboard" ).then (() => { this .$router .go (0 ) });
451
-
452
- // this.isLoading = false;
453
448
} else {
454
449
throw new Error (" No auth token" )
455
450
}
456
451
} catch (e) {
457
- this .showIcon = false
458
- // this.isLoading = false;
452
+ this .setIsLoggedOut (false )
459
453
this .notifyErr (` Error: ${ e .message } ` );
460
454
}
461
455
@@ -615,6 +609,7 @@ export default {
615
609
localStorage .removeItem (" selectedOrg" );
616
610
this .resetStore ();
617
611
this .resetMainStore ();
612
+ this .$router .go ()
618
613
},
619
614
620
615
formattedAppName (appName ) {
0 commit comments