bugs solved

This commit is contained in:
Eudes Inácio
2023-01-04 15:03:29 +01:00
parent 01b438b9f6
commit c8bdcfce8e
6 changed files with 25 additions and 21 deletions
+1 -2
View File
@@ -51,8 +51,7 @@
</ion-buttons>
</div>
<div class="line"></div>
<ion-label (click)="asyncNotification()" *ngIf="notificationdata">{{notificationdata.length}} novas notificações</ion-label>
<ion-label (click)="asyncNotification()" *ngIf="!notificationdata">0 novas notificações</ion-label>
<ion-label (click)="asyncNotification()" *ngIf="notificationdata">{{notificationStatus}}</ion-label>
</div>
</ion-header>
+6 -1
View File
@@ -31,6 +31,7 @@ export class ProfilePage implements OnInit {
location: "Gabinete";
isProfileOpen = false
hideImage = false
notificationStatus = '';
constructor(private modalController: ModalController,
private authService: AuthService,
@@ -117,7 +118,11 @@ export class ProfilePage implements OnInit {
});
this.notificationdata = this.DataArray
}).catch((error) => {
console.error('storage getnotification: ',error)
if(!error) {
this.notificationStatus = this.notificationdata.length + " novas notificações";
} else {
console.error('storage getnotification: ',error)
}
})
/* await new Promise(resolve => setTimeout(resolve, 1000));
await this.getNotificationData(); */
+6 -1
View File
@@ -225,7 +225,12 @@ export class AuthService {
this.storageService.get(AuthConnstants.AUTH).then(res=>{
this.userData$.next(res);
}).catch((error) => {
console.error('storage getuserdata',error)
if(!error) {
} else {
console.error('storage getuserdata',error)
}
});
}
@@ -48,15 +48,6 @@ export class NotificationsService {
/* private eventTriger: Events, */
/* private fcm: FCM */) {
this.storageService.get("Notifications").then((value) => {
}).catch((error)=>{
console.error('storage getnotification',error)
}).catch(() => {
this.storageService.store("Notifications", [])
})
}
registerCallback(type: string, funx: Function, object: any = {}) {
+6 -2
View File
@@ -80,9 +80,13 @@ export class HeaderPage implements OnInit {
/* var data = JSON.parse(value); */
this.notificationLength = value.length;
}).catch((error) => {
if(!error) {
this.notificationLength = 0;
} else {
console.error('header storage get notification', error)
}
})
}
hideSearch() {