mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
save
This commit is contained in:
@@ -76,53 +76,60 @@ export class ProfilePage implements OnInit {
|
||||
asyncNotification() { }
|
||||
|
||||
async getNotificationData() {
|
||||
this.storageservice.get("Notifications").then((value) => {
|
||||
|
||||
console.log('profile',this.storageservice.key("Notifications"))
|
||||
|
||||
const keyExist = await this.storageservice.keyExist("Notifications")
|
||||
|
||||
if(keyExist) {
|
||||
this.storageservice.get("Notifications").then((value) => {
|
||||
|
||||
this.DataArray = []
|
||||
value.forEach((element, i) => {
|
||||
let notificationObject;
|
||||
if (element.data) {
|
||||
notificationObject = {
|
||||
index: i,
|
||||
title: element.title,
|
||||
Service: element.data.Service,
|
||||
Object: element.data.Object,
|
||||
IdObject: element.data.IdObject,
|
||||
FolderId: element.data.FolderId,
|
||||
body: element.body,
|
||||
dateInit: this.getFormatedTime(element.data.dateInit),
|
||||
dateEnd: this.getFormatedTime(element.data.dateEnd),
|
||||
Location: element.data.Location,
|
||||
TypeAgenda: element.data.TypeAgenda,
|
||||
Role: element.data.Role,
|
||||
Status: element.data.Status
|
||||
}
|
||||
} else {
|
||||
notificationObject = {
|
||||
FolderId: element.FolderId,
|
||||
IdObject: element.IdObject,
|
||||
Location: element.Location,
|
||||
Object: element.Object,
|
||||
Role: element.Role,
|
||||
Service: element.Service,
|
||||
Status: element.Status,
|
||||
TypeAgenda: element.TypeAgenda,
|
||||
body: element.body,
|
||||
dateEnd: element.dateEnd,
|
||||
dateInit: element.dateInit,
|
||||
index: element.index,
|
||||
title: element.title
|
||||
}
|
||||
}
|
||||
|
||||
this.DataArray.push(notificationObject)
|
||||
});
|
||||
this.notificationdata = this.DataArray
|
||||
}).catch((error) => {
|
||||
console.error('storage getnotification: ',error)
|
||||
})
|
||||
}
|
||||
|
||||
this.DataArray = []
|
||||
value.forEach((element, i) => {
|
||||
let notificationObject;
|
||||
if (element.data) {
|
||||
notificationObject = {
|
||||
index: i,
|
||||
title: element.title,
|
||||
Service: element.data.Service,
|
||||
Object: element.data.Object,
|
||||
IdObject: element.data.IdObject,
|
||||
FolderId: element.data.FolderId,
|
||||
body: element.body,
|
||||
dateInit: this.getFormatedTime(element.data.dateInit),
|
||||
dateEnd: this.getFormatedTime(element.data.dateEnd),
|
||||
Location: element.data.Location,
|
||||
TypeAgenda: element.data.TypeAgenda,
|
||||
Role: element.data.Role,
|
||||
Status: element.data.Status
|
||||
}
|
||||
} else {
|
||||
notificationObject = {
|
||||
FolderId: element.FolderId,
|
||||
IdObject: element.IdObject,
|
||||
Location: element.Location,
|
||||
Object: element.Object,
|
||||
Role: element.Role,
|
||||
Service: element.Service,
|
||||
Status: element.Status,
|
||||
TypeAgenda: element.TypeAgenda,
|
||||
body: element.body,
|
||||
dateEnd: element.dateEnd,
|
||||
dateInit: element.dateInit,
|
||||
index: element.index,
|
||||
title: element.title
|
||||
}
|
||||
}
|
||||
|
||||
this.DataArray.push(notificationObject)
|
||||
});
|
||||
this.notificationdata = this.DataArray
|
||||
}).catch((error) => {
|
||||
console.error('storage getnotification: ',error)
|
||||
})
|
||||
/* await new Promise(resolve => setTimeout(resolve, 1000));
|
||||
await this.getNotificationData(); */
|
||||
}
|
||||
|
||||
|
||||
@@ -216,12 +223,12 @@ export class ProfilePage implements OnInit {
|
||||
|
||||
setTimeout(() => {
|
||||
// alert('logout')
|
||||
this.router.navigateByUrl('/', { replaceUrl: true });
|
||||
this.router.navigate(['/']);
|
||||
this.router.navigateByUrl('/auth', { replaceUrl: true });
|
||||
this.router.navigate(['/auth']);
|
||||
|
||||
setTimeout(() =>{
|
||||
if(this.logoutOut == false) {
|
||||
window.location.pathname = '/'
|
||||
window.location.pathname = '/auth'
|
||||
}
|
||||
}, 500)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user