mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 05:16:07 +00:00
IMprove
This commit is contained in:
@@ -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 ">
|
||||||
|
|
||||||
|
|||||||
@@ -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) )
|
||||||
|
|||||||
Reference in New Issue
Block a user