diff --git a/src/app/home/home.page.ts b/src/app/home/home.page.ts index b759fa172..4a358eb41 100644 --- a/src/app/home/home.page.ts +++ b/src/app/home/home.page.ts @@ -184,7 +184,7 @@ export class HomePage implements OnInit { this.webNotificationPopupService.sendNotification(DataArray.Object) - this.storageService.get('Notifications').then((data)=>{ + this.storageService.get('Notifications').then((data:any)=>{ data.push(DataArray) this.storageService.store("Notifications", data) }).catch(()=>{ diff --git a/src/app/services/ageanda/list-box.service.ts b/src/app/services/ageanda/list-box.service.ts index 6e5458ae2..5dff546f9 100644 --- a/src/app/services/ageanda/list-box.service.ts +++ b/src/app/services/ageanda/list-box.service.ts @@ -30,8 +30,6 @@ export class ListBoxService { list(eventSource: EventListStore[], profile: 'md' | 'pr' | 'all', rangeStartDate, randEndDate, {segment = 'todo'}) { - console.log('eventSource: EventListStore[]',eventSource) - if(profile != 'all') { eventSource = this.filterProfile(eventSource, profile) } diff --git a/src/app/services/notification/web-notification-popup.service.ts b/src/app/services/notification/web-notification-popup.service.ts index e4e89dc64..4dac3fe48 100644 --- a/src/app/services/notification/web-notification-popup.service.ts +++ b/src/app/services/notification/web-notification-popup.service.ts @@ -45,6 +45,9 @@ export class WebNotificationPopupService { } sendNotification(message) { + if (this.platform.is('desktop') || this.platform.is('mobileweb')) {} + else {return false} + var n = new Notification(message); } } diff --git a/src/app/services/notifications.service.ts b/src/app/services/notifications.service.ts index d04433176..cf7d3197c 100644 --- a/src/app/services/notifications.service.ts +++ b/src/app/services/notifications.service.ts @@ -54,9 +54,7 @@ export class NotificationsService { registerCallback(type: string, funx: Function, object: any = {} ) { this.callbacks.push({type, funx}) - if(!object.hasOwnProperty('desktop') && object['desktop'] != false) { - synchro.registerCallback('Notification',funx, type) - } + synchro.registerCallback('Notification',funx, type) } diff --git a/src/app/services/socket/synchro.service.ts b/src/app/services/socket/synchro.service.ts index dd19ac1f2..88eb2d374 100644 --- a/src/app/services/socket/synchro.service.ts +++ b/src/app/services/socket/synchro.service.ts @@ -133,8 +133,8 @@ class SynchroService { if(idConnection != this.id ) { - if(window['platform'].is('desktop') || this.platform.is('mobileweb')) {} - else return false + //if(window['platform'].is('desktop') || this.platform.is('mobileweb')) {} + //else return false if(environment.production) return false diff --git a/src/app/services/storage.service.ts b/src/app/services/storage.service.ts index 37bb2b92b..31efdf205 100644 --- a/src/app/services/storage.service.ts +++ b/src/app/services/storage.service.ts @@ -11,7 +11,6 @@ const { Storage } = Plugins; */ export class StorageService { private keyName: string; - constructor(private storage:Storage, private platform: Platform ) {} @@ -22,50 +21,27 @@ const { Storage } = Plugins; */ // Store the value async store(key: string, value: any) { - if (this.platform.is('desktop') || this.platform.is('mobileweb')) { - await localstoreService.set(this.key(key), value) - } else { - const encryptedValue = btoa(escape(JSON.stringify(value))); - await this.storage.set(key, encryptedValue); - } + + await localstoreService.set(this.key(key), value) } // Get the value - async get(key: string) { - - - if (this.platform.is('desktop') || this.platform.is('mobileweb')) { - return new Promise((resolve, reject)=>{ - const data = localstoreService.get(this.key(key), false) - if(data) resolve(data) - else reject(data) - }) - } else { - const ret = await this.storage.get(key).then((val) => { return val; }); - try { - return JSON.parse(unescape(atob(ret))); - } catch (error) { - if(ret == 'žée') { - throw(key+' not found') - } - return unescape(atob(ret)) - } - } + async get(key: string): Promise { + return new Promise((resolve, reject)=>{ + const data = localstoreService.get(this.key(key), false) + if(data) resolve(data) + else reject(data) + }) } async remove(key: string){ - if (this.platform.is('desktop') || this.platform.is('mobileweb')) { - await localstoreService.delete(this.key(key)) - } else { - await this.storage.remove(key); - } + await localstoreService.delete(this.key(key)) } - /* // Get the value async get(storageKey: string) {