From 4109e30d0772063fe33a0d1313dda48a2f1d808c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eudes=20In=C3=A1cio?= Date: Wed, 26 Jul 2023 09:47:31 +0100 Subject: [PATCH 1/3] Notification stop duplication --- src/app/home/home.page.ts | 1 + src/app/services/notifications.service.ts | 7 +++---- version/git-version.ts | 14 +++++++------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/app/home/home.page.ts b/src/app/home/home.page.ts index e11d52aa3..046881b4e 100644 --- a/src/app/home/home.page.ts +++ b/src/app/home/home.page.ts @@ -234,6 +234,7 @@ export class HomePage implements OnInit { logDeviceInfo = async () => { const info = await Device.getInfo(); + /* console.log('DEVICE INFO ',info); */ } updateList() { diff --git a/src/app/services/notifications.service.ts b/src/app/services/notifications.service.ts index 698c5f41a..c35bd73e6 100644 --- a/src/app/services/notifications.service.ts +++ b/src/app/services/notifications.service.ts @@ -138,7 +138,7 @@ export class NotificationsService { PushNotifications.addListener('pushNotificationReceived', (notification: PushNotificationSchema) => { this.active = true - + console.log('NOtification Listener', notification) this.storenotification(notification) this.eventtrigger.publishSomeData({ notification: "recive" @@ -148,7 +148,6 @@ export class NotificationsService { } else { this.afMessaging.messages.subscribe((notification) => { - this.storenotification(notification) this.storenotification(notification) this.notificationReceived.emit(); this.eventtrigger.publishSomeData({ @@ -160,7 +159,7 @@ export class NotificationsService { } storenotification(notification) { - console.log(notification) + console.log('Store Notification ',notification) this.storageService.get("Notifications").then((store) => { store.push(notification) @@ -180,7 +179,7 @@ export class NotificationsService { PushNotifications.addListener('pushNotificationActionPerformed', (notification: ActionPerformed) => { this.active = true - console.log(notification) + console.log('NOtification Listener Backgroud', notification) /* this.DataArray.push(notification.notification) this.storageService.store("Notifications", this.DataArray) diff --git a/version/git-version.ts b/version/git-version.ts index f9e8b7b12..5ab15c05e 100644 --- a/version/git-version.ts +++ b/version/git-version.ts @@ -1,12 +1,12 @@ export let versionData = { - "shortSHA": "ba8fce1ec", - "SHA": "ba8fce1ec8e391c9ae1327a6da973ffc03561d36", + "shortSHA": "54a6fb5b6", + "SHA": "54a6fb5b6eb5d1afc53a6067dfd64519c3c3fa87", "branch": "developer-catch-merge", "lastCommitAuthor": "'Peter Maquiran'", - "lastCommitTime": "'Mon Jul 24 10:23:03 2023 +0100'", - "lastCommitMessage": "fix", - "lastCommitNumber": "5106", + "lastCommitTime": "'Mon Jul 24 13:52:48 2023 +0100'", + "lastCommitMessage": "change", + "lastCommitNumber": "5107", "change": "", - "changeStatus": "On branch developer-catch-merge\nChanges to be committed:\n (use \"git restore --staged ...\" to unstage)\n\tmodified: src/app/pages/gabinete-digital/diplomas-assinar/diploma-assinar/diploma-assinar.page.ts\n\tmodified: src/app/pages/gabinete-digital/gabinete-digital.page.html\n\tmodified: src/app/shared/popover/deploma-options/deploma-options.page.scss\n\tmodified: src/app/shared/popover/deploma-options/deploma-options.page.ts", - "changeAuthor": "peter.maquiran" + "changeStatus": "On branch developer-catch-merge\nYour branch is behind 'origin/developer-catch-merge' by 3 commits, and can be fast-forwarded.\n (use \"git pull\" to update your local branch)\n\nChanges to be committed:\n (use \"git restore --staged ...\" to unstage)\n\tmodified: src/app/home/home.page.ts\n\tmodified: src/app/services/notifications.service.ts", + "changeAuthor": "eudes.inacio" } \ No newline at end of file From f22590357e16e8fa3a2c3ba96ca18994a1507ccb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eudes=20In=C3=A1cio?= Date: Sun, 30 Jul 2023 21:42:56 +0100 Subject: [PATCH 2/3] tinymce language pt --- src/app/tiny-mce/tiny-mce.page.html | 1 + version/git-version.ts | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/app/tiny-mce/tiny-mce.page.html b/src/app/tiny-mce/tiny-mce.page.html index 356a848a8..9a8674c9f 100644 --- a/src/app/tiny-mce/tiny-mce.page.html +++ b/src/app/tiny-mce/tiny-mce.page.html @@ -21,6 +21,7 @@ apiKey="wr5dk69kive0qr9ig6y5spqvlj3a0tsiwnzdsexnz241k69p" [(ngModel)]="editorContent" [init]="{ + language: 'pt_PT', height: 600, menubar: false, plugins: [ diff --git a/version/git-version.ts b/version/git-version.ts index 33e2fd5ad..381028734 100644 --- a/version/git-version.ts +++ b/version/git-version.ts @@ -1,12 +1,12 @@ export let versionData = { - "shortSHA": "4f467a390", - "SHA": "4f467a3900f0c9818b7a60187a394aa38dab2633", + "shortSHA": "fbd4b87fe", + "SHA": "fbd4b87fe5b11d3539da0c7228a9749d29ec7f12", "branch": "developer-catch-merge", "lastCommitAuthor": "'Eudes Inácio'", - "lastCommitTime": "'Thu Jul 27 15:18:47 2023 +0100'", - "lastCommitMessage": "git pull made", - "lastCommitNumber": "5114", + "lastCommitTime": "'Thu Jul 27 15:20:13 2023 +0100'", + "lastCommitMessage": "pull made", + "lastCommitNumber": "5122", "change": "", - "changeStatus": "On branch developer-catch-merge\nYour branch and 'origin/developer-catch-merge' have diverged,\nand have 3 and 7 different commits each, respectively.\n (use \"git pull\" to merge the remote branch into yours)\n\nAll conflicts fixed but you are still merging.\n (use \"git commit\" to conclude merge)\n\nChanges to be committed:\n\tmodified: ios/App/App.xcodeproj/project.pbxproj\n\tmodified: ios/App/Podfile\n\tmodified: src/app/modals/profile/edit-profile/edit-profile.page.html\n\tmodified: src/app/modals/profile/profile.page.html\n\tmodified: src/app/pages/agenda/view-event/view-event.page.html\n\tmodified: src/app/pages/chat/group-messages/group-messages.page.scss\n\tmodified: src/app/pages/chat/messages/messages.page.scss\n\tmodified: src/app/pages/events/events.page.scss\n\tmodified: src/app/pages/gabinete-digital/despachos/despacho/despacho.page.html\n\tmodified: src/app/pages/gabinete-digital/despachos/despachos.page.html\n\tmodified: src/app/pages/gabinete-digital/diplomas-assinar/diplomas-assinar.page.html\n\tmodified: src/app/pages/gabinete-digital/diplomas-gerar/diplomas-gerar.page.html\n\tmodified: src/app/pages/gabinete-digital/diplomas/diplomas.page.html\n\tmodified: src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.html\n\tmodified: src/app/pages/gabinete-digital/expediente/expediente.page.html\n\tmodified: src/app/pages/gabinete-digital/expedientes-pr/expediente-pr/expediente-pr.page.html\n\tmodified: src/app/pages/gabinete-digital/gabinete-digital.page.html\n\tmodified: src/app/pages/gabinete-digital/gabinete-digital.page.scss\n\tmodified: src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.html\n\tmodified: src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.scss\n\tmodified: src/app/pages/gabinete-digital/pedidos/pedidos.page.html\n\tmodified: src/app/pages/inactivity/inactivity.page.html\n\tmodified: src/app/pages/search/search.page.html\n\tmodified: src/app/pages/search/search.page.ts\n\tmodified: src/app/shared/agenda/edit-event/edit-event.page.html\n\tmodified: src/app/shared/agenda/view-event/view-event.page.html\n\tmodified: src/app/shared/btn-modal-dismiss/btn-modal-dismiss.page.html\n\tmodified: src/app/shared/gabinete-digital/all-processes/all-processes.page.html\n\tmodified: src/app/shared/gabinete-digital/all-processes/all-processes.page.scss\n\tmodified: src/app/shared/gabinete-digital/diplomas-gerar/diplomas-gerar.page.html\n\tmodified: src/app/shared/gabinete-digital/diplomas/diplomas.page.html\n\tmodified: src/app/shared/gabinete-digital/generic/task-list/task-list.page.html\n\tmodified: src/app/shared/gabinete-digital/pedidos/pedidos.page.html\n\tmodified: src/app/shared/popover/chat-popover/chat-popover.page.html\n\tmodified: src/app/shared/publication/new-publication/new-publication.page.ts\n\tmodified: src/app/tiny-mce/tiny-mce.page.scss\n\tmodified: src/app/tiny-mce/tiny-mce.page.ts\n\tmodified: src/style/ios.scss", + "changeStatus": "On branch developer-catch-merge\nYour branch is ahead of 'origin/developer-catch-merge' by 4 commits.\n (use \"git push\" to publish your local commits)\n\nChanges to be committed:\n (use \"git restore --staged ...\" to unstage)\n\tmodified: src/app/tiny-mce/tiny-mce.page.html", "changeAuthor": "eudes.inacio" } \ No newline at end of file From a0591878852492c56134ff984c8ce56a75329b28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eudes=20In=C3=A1cio?= Date: Thu, 3 Aug 2023 13:04:58 +0100 Subject: [PATCH 3/3] duplication of notification solved --- src/app/modals/profile/profile.page.ts | 1 + src/app/pages/login/login.page.ts | 2 +- src/app/services/notifications.service.ts | 18 +++++++++++++++++- version/git-version.ts | 12 ++++++------ 4 files changed, 25 insertions(+), 8 deletions(-) diff --git a/src/app/modals/profile/profile.page.ts b/src/app/modals/profile/profile.page.ts index 5ff1e22eb..3172432d5 100644 --- a/src/app/modals/profile/profile.page.ts +++ b/src/app/modals/profile/profile.page.ts @@ -103,6 +103,7 @@ export class ProfilePage implements OnInit { this.DataArray = [] value.forEach((element, i) => { + console.log('Getnotifications',element, i ) let notificationObject; if (element.notification) { diff --git a/src/app/pages/login/login.page.ts b/src/app/pages/login/login.page.ts index 77967517b..06478d540 100644 --- a/src/app/pages/login/login.page.ts +++ b/src/app/pages/login/login.page.ts @@ -139,7 +139,7 @@ export class LoginPage implements OnInit { } this.changeProfileService.runLogin(); - this.getToken(); + /* this.getToken(); */ SessionStore.setInativity(true); this.goback(); diff --git a/src/app/services/notifications.service.ts b/src/app/services/notifications.service.ts index 4c18c80a3..23eb8bf2b 100644 --- a/src/app/services/notifications.service.ts +++ b/src/app/services/notifications.service.ts @@ -163,7 +163,23 @@ export class NotificationsService { this.storageService.get("Notifications").then((store) => { store.push(notification) - this.storageService.store("Notifications", store) + console.log('Store Notification ',store) + + const result = store.reduce((accumulator, current) => { + let exists = accumulator.find(item => { + return item.id === current.id; + }); + if(!exists) { + accumulator = accumulator.concat(current); + } + return accumulator; + }, []); + + console.log(result); + + + + this.storageService.store("Notifications", result) }).catch((error) => { if (!error) { this.storageService.store("Notifications", [notification]) diff --git a/version/git-version.ts b/version/git-version.ts index eba9024fd..85a3583ab 100644 --- a/version/git-version.ts +++ b/version/git-version.ts @@ -1,12 +1,12 @@ export let versionData = { - "shortSHA": "df8fbc373", - "SHA": "df8fbc373ea871a70c5cddc0341f210a82a3fc56", + "shortSHA": "c96aad213", + "SHA": "c96aad2136d71846600d94c92d4a2f82439a0e3c", "branch": "developer", "lastCommitAuthor": "'Eudes Inácio'", - "lastCommitTime": "'Mon Jul 31 16:41:50 2023 +0100'", - "lastCommitMessage": "pull made", - "lastCommitNumber": "5131", + "lastCommitTime": "'Mon Jul 31 16:58:36 2023 +0100'", + "lastCommitMessage": "pull made and remove time from notification erro", + "lastCommitNumber": "5133", "change": "", - "changeStatus": "On branch developer\nYour branch and 'origin/developer' have diverged,\nand have 7 and 1 different commits each, respectively.\n (use \"git pull\" to merge the remote branch into yours)\n\nAll conflicts fixed but you are still merging.\n (use \"git commit\" to conclude merge)\n\nChanges to be committed:\n\tmodified: src/app/modals/profile/profile.page.html\n\tmodified: src/app/pages/gabinete-digital/event-list/approve-event/approve-event.page.html\n\tmodified: src/app/pages/gabinete-digital/event-list/approve-event/approve-event.page.scss\n\tmodified: src/app/pages/gabinete-digital/event-list/approve-event/approve-event.page.ts\n\tmodified: src/app/shared/agenda/approve-event/approve-event.page.html", + "changeStatus": "On branch developer\nYour branch is ahead of 'origin/developer' by 8 commits.\n (use \"git push\" to publish your local commits)\n\nChanges to be committed:\n (use \"git restore --staged ...\" to unstage)\n\tmodified: src/app/modals/profile/profile.page.ts\n\tmodified: src/app/pages/login/login.page.ts\n\tmodified: src/app/services/notifications.service.ts", "changeAuthor": "eudes.inacio" } \ No newline at end of file