This commit is contained in:
Peter Maquiran
2021-07-02 09:29:01 +01:00
parent 81cc783033
commit 420e0ee473
2 changed files with 22 additions and 22 deletions
+1
View File
@@ -1,4 +1,5 @@
<ion-content class="text-white">
<div class="main-wrapper">
<div class="wrapper" *ngIf="!hasSession && !setPin || loginPreference == 'none' && !setPin ">
+21 -22
View File
@@ -34,36 +34,34 @@ export class LoginPage implements OnInit {
private toastService: ToastService,
public alertController: AlertController
) {
}
ngOnInit() {
// App has session
if(!localStorage.getItem('UserData')) {
this.hasSession = false
} else {
this.hasSession = true
// this.router.navigate(['/home/events']);
}
// App has session
if(!localStorage.getItem('UserData')) {
this.hasSession = false
} else {
this.hasSession = true
// this.router.navigate(['/home/events']);
}
let userData = JSON.parse(localStorage.getItem('UserData')) || {}
let userData = JSON.parse(localStorage.getItem('UserData')) || {}
const loginPreference = userData?.loginPreference
const pin = userData?.PIN
const loginPreference = userData?.loginPreference
const pin = userData?.PIN
if (pin) {
this.hasPin = true
} else {
this.hasPin = false
}
if (pin) {
this.hasPin = true
} else {
this.hasPin = false
}
if (loginPreference) {
this.loginPreference = loginPreference
} else {
this.loginPreference = ''
}
if (loginPreference) {
this.loginPreference = loginPreference
} else {
this.loginPreference = ''
}
}
@@ -203,6 +201,7 @@ export class LoginPage implements OnInit {
let userData: Object = JSON.parse(localStorage.getItem('UserData')) || {}
userData['PIN'] = encrypted
userData['loginPreference'] = 'none'
localStorage.setItem('UserData', JSON.stringify(userData) )