Notification on perfil menu

This commit is contained in:
Eudes Inácio
2021-07-31 22:04:09 +01:00
parent 3b594f2000
commit 7ac8ba793f
6 changed files with 141 additions and 56 deletions
+24 -7
View File
@@ -1,3 +1,5 @@
///<reference path="../../../../plugins/cordova-plugin-mfp/typings/worklight.d.ts" />
///<reference path="../../../../plugins/cordova-plugin-mfp-jsonstore/typings/jsonstore.d.ts" />
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { AnimationController, ModalController } from '@ionic/angular';
@@ -7,6 +9,8 @@ import { FingerprintPage } from 'src/app/shared/fingerprint/fingerprint.page';
import { PinPage } from 'src/app/shared/pin/pin.page';
import { LocalstoreService } from 'src/app/store/localstore.service';
import { EditProfilePage } from './edit-profile/edit-profile.page';
import { JsonStore } from '../../services/jsonStore.service';
import { StorageService } from '../../services/storage.service';
@Component({
selector: 'app-profile',
@@ -17,13 +21,17 @@ export class ProfilePage implements OnInit {
loggeduser: User;
userLoginPreference = ''
notificationdata:any[];
DataArray: Array<String> = [];
constructor(private modalController:ModalController,
constructor(private modalController: ModalController,
private authService: AuthService,
private animationController: AnimationController,
private router: Router,
private localstoreService: LocalstoreService
) {
private localstoreService: LocalstoreService,
private jsonstore: JsonStore,
private storageservice: StorageService
) {
this.loggeduser = authService.ValidatedUser;
@@ -32,19 +40,28 @@ export class ProfilePage implements OnInit {
this.checkState()
}
ngOnInit() {}
ngOnInit() {
this.storageservice.get("Notifications").then((value) => {
var data = JSON.parse(value);
this.notificationdata = data
console.log("Notificaaa", this.notificationdata)
})
console.log("Notificaaa", this.notificationdata)
}
close() {
this.modalController.dismiss();
}
notImplemented(){}
notImplemented() { }
logout() {
// clear local storage
window.localStorage.clear();
setTimeout(()=>{
setTimeout(() => {
window.location.pathname = '/'
location.reload();
}, 1000)
@@ -58,7 +75,7 @@ export class ProfilePage implements OnInit {
if (userData.hasOwnProperty('loginPreference')) {
this.userLoginPreference = userData.loginPreference
} else {
this.userLoginPreference = ''
this.userLoginPreference = ''
}
}