Added if condition for icon on notification profile

This commit is contained in:
Eudes Inácio
2021-08-01 21:04:13 +01:00
parent d062fe0ff3
commit 71996879b4
2 changed files with 26 additions and 22 deletions
+23 -4
View File
@@ -21,8 +21,8 @@ export class ProfilePage implements OnInit {
loggeduser: User;
userLoginPreference = ''
notificationdata:any[];
DataArray: Array<String> = [];
notificationdata: any[];
DataArray: Array<Object> = [];
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)