This commit is contained in:
Peter Maquiran
2021-08-31 09:00:33 +01:00
parent 23d73c6d5f
commit 6b61630abc
11 changed files with 157 additions and 58 deletions
+17 -15
View File
@@ -11,6 +11,7 @@ import { JsonStore } from '../../services/jsonStore.service';
import { StorageService } from '../../services/storage.service';
import { NotificationsService } from '../../services/notifications.service';
import { SessionStore } from 'src/app/store/session.service';
import { synchro } from 'src/app/services/socket/synchro.service';
@Component({
selector: 'app-profile',
@@ -42,24 +43,35 @@ export class ProfilePage implements OnInit {
private zone: NgZone,
private notificationservice: NotificationsService,
private platform: Platform,
private notificationsService: NotificationsService,
) {
this.loggeduser = authService.ValidatedUser;
console.log(this.loggeduser.RoleDescription)
this.checkState()
}
ngOnInit() {
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
console.log('Notifications not supported')
this.getNotificationData();
} else {
this.getNotificationData();
this.getNotificationData();
}
this.notificationsService.registerCallback(
'any',
() => {
setTimeout(()=>{
this.getNotificationData();
}, 100)
}
)
}
close() {
this.modalController.dismiss();
}
@@ -68,7 +80,7 @@ export class ProfilePage implements OnInit {
asyncNotification(){}
async getNotificationData(){
async getNotificationData() {
this.storageservice.get("Notifications").then((value) => {
console.log("Init get store", value)
@@ -78,6 +90,8 @@ export class ProfilePage implements OnInit {
value = JSON.parse(value)
console.log("CSDfdvdf",value)
}
this.DataArray = []
value.forEach((element,i) => {
console.log("ARaaAA", element)
let notificationObject;
@@ -213,18 +227,6 @@ export class ProfilePage implements OnInit {
}
checkState() {
let userData = this.localstoreService.get('UserData', {})
if (userData.hasOwnProperty('loginPreference')) {
this.userLoginPreference = userData.loginPreference
} else {
this.userLoginPreference = ''
}
}
async editProfile() {
const enterAnimation = (baseEl: any) => {