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"> <ion-content class="text-white">
<div class="main-wrapper"> <div class="main-wrapper">
<div class="wrapper" *ngIf="!hasSession && !setPin || loginPreference == 'none' && !setPin "> <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, private toastService: ToastService,
public alertController: AlertController public alertController: AlertController
) { ) {
} }
ngOnInit() { ngOnInit() {
// App has session // App has session
if(!localStorage.getItem('UserData')) { if(!localStorage.getItem('UserData')) {
this.hasSession = false this.hasSession = false
} else { } else {
this.hasSession = true this.hasSession = true
// this.router.navigate(['/home/events']); // this.router.navigate(['/home/events']);
} }
let userData = JSON.parse(localStorage.getItem('UserData')) || {} let userData = JSON.parse(localStorage.getItem('UserData')) || {}
const loginPreference = userData?.loginPreference const loginPreference = userData?.loginPreference
const pin = userData?.PIN const pin = userData?.PIN
if (pin) { if (pin) {
this.hasPin = true this.hasPin = true
} else { } else {
this.hasPin = false this.hasPin = false
} }
if (loginPreference) { if (loginPreference) {
this.loginPreference = loginPreference this.loginPreference = loginPreference
} else {
} else { this.loginPreference = ''
this.loginPreference = '' }
}
} }
@@ -203,6 +201,7 @@ export class LoginPage implements OnInit {
let userData: Object = JSON.parse(localStorage.getItem('UserData')) || {} let userData: Object = JSON.parse(localStorage.getItem('UserData')) || {}
userData['PIN'] = encrypted userData['PIN'] = encrypted
userData['loginPreference'] = 'none'
localStorage.setItem('UserData', JSON.stringify(userData) ) localStorage.setItem('UserData', JSON.stringify(userData) )