mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
Merge branch 'developer' of https://bitbucket.org/equilibriumito/gabinete-digital into developer
This commit is contained in:
@@ -6,6 +6,7 @@ import { LoginUserRespose } from 'src/app/models/user.model';
|
||||
import { ProfilePage } from 'src/app/modals/profile/profile.page';
|
||||
import { StorageService } from '../../services/storage.service';
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
import { NotificationsService } from '../../services/notifications.service';
|
||||
import { environment } from 'src/environments/environment';
|
||||
|
||||
@Component({
|
||||
@@ -32,6 +33,7 @@ export class HeaderPage implements OnInit {
|
||||
private animationController: AnimationController,
|
||||
private storageservice: StorageService,
|
||||
private platform: Platform,
|
||||
private notificationsService: NotificationsService,
|
||||
) {
|
||||
this.loggeduser = SessionStore.user;
|
||||
router.events.subscribe((val) => {
|
||||
@@ -45,21 +47,28 @@ export class HeaderPage implements OnInit {
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
console.log('Notifications not supported')
|
||||
} else {
|
||||
this.notificationLengthData();
|
||||
this.UpdateNotificationCount();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
async notificationLengthData() {
|
||||
UpdateNotificationCount() {
|
||||
this.notificationsService.registerCallback(
|
||||
'any',
|
||||
() => {
|
||||
this.notificationLengthData();
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
notificationLengthData() {
|
||||
this.storageservice.get("Notifications").then((value) => {
|
||||
console.log("Init get store", value)
|
||||
|
||||
var data = JSON.parse(value);
|
||||
this.notificationLength = data.length;
|
||||
/* var data = JSON.parse(value); */
|
||||
this.notificationLength = value.length;
|
||||
})
|
||||
|
||||
await new Promise(resolve => setTimeout(resolve, 10000))
|
||||
await this.notificationLengthData()
|
||||
console.log('Timer badge count')
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user