Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/app/core/services/http/http.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,14 @@ export class HttpService {
await alert.present();
let data = await alert.onDidDismiss();
if (data.role == 'cancel') {
let auth = this.injector.get(AuthService);
auth.logoutAccount(true);
if(environment.isAuthBypassed) {
let auth = this.injector.get(AuthService);
auth.clearLocalData();
location.href = environment.unauthorizedRedirectUrl
} else {
let auth = this.injector.get(AuthService);
auth.logoutAccount(true);
}
}
return false;
} else {
Expand Down
7 changes: 3 additions & 4 deletions src/app/pages/tabs/home/home.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ export class HomePage implements OnInit {

async ngOnInit() {
await this.getUser();
if(this.user && !this.user.profile_mandatory_fields.length){
this.getSessions();
}
this.isMentor = this.profileService.isMentor
App.addListener('appStateChange', (state: AppState) => {
this.localStorage.getLocalData(localKeys.USER_DETAILS).then(data => {
Expand Down Expand Up @@ -98,10 +101,6 @@ export class HomePage implements OnInit {
}

async ionViewWillEnter() {
this.user = await this.localStorage.getLocalData(localKeys.USER_DETAILS);
if(this.user && !this.user.profile_mandatory_fields.length){
this.getSessions();
}
this.gotToTop();
let isRoleRequested = await this.localStorage.getLocalData(localKeys.IS_ROLE_REQUESTED)
let isBecomeMentorTileClosed =await this.localStorage.getLocalData(localKeys.IS_BECOME_MENTOR_TILE_CLOSED)
Expand Down