mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
Login preference
This commit is contained in:
@@ -29,15 +29,16 @@
|
||||
|
||||
<ion-row>
|
||||
<ion-col class="align-center d-flex">
|
||||
<div class="d-flex align-center">
|
||||
<ion-checkbox (ionChange)="LoginPreference('pin')" class="checkBox" ></ion-checkbox>
|
||||
<div class="d-flex align-center" (click)="LoginPreferenceMethod('pin')">
|
||||
<!-- -->
|
||||
<ion-checkbox [checked]="userLoginPreference=='pin' " class="checkBox" ></ion-checkbox>
|
||||
PIN
|
||||
</div>
|
||||
|
||||
</ion-col>
|
||||
<ion-col class="align-center d-flex">
|
||||
<div (click)="addFingerprint()" class="d-flex align-center">
|
||||
<ion-checkbox (ionChange)="LoginPreference('pin')" class="checkBox"></ion-checkbox>
|
||||
<ion-checkbox class="checkBox" [checked]="false"></ion-checkbox>
|
||||
Impressão Digital
|
||||
</div>
|
||||
</ion-col>
|
||||
|
||||
@@ -110,15 +110,37 @@ export class ProfileComponent implements OnInit {
|
||||
this.router.navigate(['/']);
|
||||
}
|
||||
|
||||
LoginPreference(type: string) {
|
||||
LoginPreferenceMethod(type: string) {
|
||||
|
||||
let userData = JSON.parse(localStorage.getItem('UserData')) || {}
|
||||
|
||||
let userData = JSON.parse(localStorage.getItem('UserData'))
|
||||
|
||||
userData.loginPreference = type
|
||||
if (userData.hasOwnProperty('loginPreference')) {
|
||||
if (userData.loginPreference != type) {
|
||||
if (type) {
|
||||
userData.loginPreference = type
|
||||
}
|
||||
} else {
|
||||
userData.loginPreference = 'none'
|
||||
}
|
||||
|
||||
} else {
|
||||
userData.loginPreference = 'none'
|
||||
}
|
||||
|
||||
localStorage.setItem('UserData', JSON.stringify(userData) )
|
||||
|
||||
}
|
||||
|
||||
get userLoginPreference() {
|
||||
|
||||
let userData = JSON.parse(localStorage.getItem('UserData')) || {}
|
||||
|
||||
if (userData.hasOwnProperty('loginPreference')) {
|
||||
console.log( userData.loginPreference)
|
||||
return userData.loginPreference
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user