From 71996879b419f88d4cef756ea5745dd49a27cacc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eudes=20In=C3=A1cio?= Date: Sun, 1 Aug 2021 21:04:13 +0100 Subject: [PATCH] Added if condition for icon on notification profile --- src/app/modals/profile/profile.page.html | 21 +++--------------- src/app/modals/profile/profile.page.ts | 27 ++++++++++++++++++++---- 2 files changed, 26 insertions(+), 22 deletions(-) diff --git a/src/app/modals/profile/profile.page.html b/src/app/modals/profile/profile.page.html index 0552d126c..e357617fb 100644 --- a/src/app/modals/profile/profile.page.html +++ b/src/app/modals/profile/profile.page.html @@ -30,16 +30,16 @@
- {{notificationdata.length}] novas notificações + {{notificationdata.length}} novas notificações
- + +
- {{ item.dateInit }}

{{item.dateInit}}

{{item.dateEnd}}

@@ -50,21 +50,6 @@
-
-
-
- -
-
-

28-07-21

-

09:00

-
-
-

Relatório FMI

-

Luanda | Palácio Presidencial

-
-
-
diff --git a/src/app/modals/profile/profile.page.ts b/src/app/modals/profile/profile.page.ts index 01ec12877..2e9669a8d 100644 --- a/src/app/modals/profile/profile.page.ts +++ b/src/app/modals/profile/profile.page.ts @@ -21,8 +21,8 @@ export class ProfilePage implements OnInit { loggeduser: User; userLoginPreference = '' - notificationdata:any[]; - DataArray: Array = []; + notificationdata: any[]; + DataArray: Array = []; constructor(private modalController: ModalController, private authService: AuthService, @@ -42,9 +42,28 @@ export class ProfilePage implements OnInit { ngOnInit() { this.storageservice.get("Notifications").then((value) => { - + var data = JSON.parse(value); - this.notificationdata = data + data.forEach(element => { + console.log("ARaaAA", element) + var payload = JSON.parse(element.payload) + let notificationObject = { + alert: element.alert, + Service: payload.Service, + Object: payload.Object, + IdObject: payload.IdObject, + FolderId: payload.FolderId, + desc: payload.desc, + dateInit: payload.dateInit, + dateEnd: payload.dateEnd, + Location: payload.Location, + TypeAgenda: payload.TypeAgenda, + Status: payload.Status + } + + this.DataArray.push(notificationObject) + }); + this.notificationdata = this.DataArray console.log("Notificaaa", this.notificationdata) }) console.log("Notificaaa", this.notificationdata)