diff --git a/src/app/pages/gabinete-digital/gabinete-digital.page.html b/src/app/pages/gabinete-digital/gabinete-digital.page.html
index 11a33dd14..ac5805b8e 100644
--- a/src/app/pages/gabinete-digital/gabinete-digital.page.html
+++ b/src/app/pages/gabinete-digital/gabinete-digital.page.html
@@ -285,7 +285,7 @@
{{ deplomasStore.diplomasParaAssinartCount }} Documentos
-
+
diff --git a/src/app/pages/gabinete-digital/gabinete-digital.page.ts b/src/app/pages/gabinete-digital/gabinete-digital.page.ts
index c4c4cbc15..674a59a16 100644
--- a/src/app/pages/gabinete-digital/gabinete-digital.page.ts
+++ b/src/app/pages/gabinete-digital/gabinete-digital.page.ts
@@ -196,84 +196,87 @@ export class GabineteDigitalPage implements OnInit {
// }
// })
- this.backgroundservice.registerBackService('Online', () => {
- // this.loadAllProcesses();
- });
+ setTimeout(() => {
+
+ this.backgroundservice.registerBackService('Online', () => {
+ // this.loadAllProcesses();
+ });
+ // this.NotificationsService.registerCallback({
+ // type:'despachos',
+ // funx:() => {
+ // // this.loadCount();
+ // console.log('refresh with notification')
+ // }
+ // })
- // this.NotificationsService.registerCallback({
- // type:'despachos',
- // funx:() => {
- // // this.loadCount();
- // console.log('refresh with notification')
- // }
- // })
+ // this.NotificationsService.registerCallback({
+ // type:'*',
+ // funx:() => {
+ // // this.LoadCounts();
+ // console.log('refresh with notification *')
+ // }
+ // })
- // this.NotificationsService.registerCallback({
- // type:'*',
- // funx:() => {
- // // this.LoadCounts();
- // console.log('refresh with notification *')
- // }
- // })
-
- // this.NotificationsService.registerCallback({
- // type:'despachos-pr',
- // funx:() => {
- // // this.LoadCounts();
- // console.log('refresh with notification')
- // }
- // })
- // this.NotificationsService.registerCallback({
- // type:'expediente',
- // funx: () => {
- // this.LoadCounts();
- // console.log('refresh with notification')
- // }
- // })
- // this.NotificationsService.registerCallback({
- // type:'gabinete-digital',
- // funx:() => {
- // this.LoadCounts();
- // console.log('refresh with notification')
- // }
- // })
- // this.NotificationsService.registerCallback({
- // type:'parecer',
- // funx: () => {
- // this.LoadCounts();
- // console.log('refresh with notification')
- // }
- // })
- // this.NotificationsService.registerCallback({
- // type: 'deferimento',
- // funx: () => {
- // this.LoadCounts();
- // console.log('refresh with notification')
- // }
- // })
- // this.NotificationsService.registerCallback({
- // type: 'diplomas-assinar',
- // funx: () => {
- // this.LoadCounts();
- // console.log('refresh with notification')
- // }
- // })
- // this.NotificationsService.registerCallback({
- // type: 'diplomas',
- // funx: () => {
- // this.LoadCounts();
- // console.log('refresh with notification')
- // }
- // })
- // this.NotificationsService.registerCallback({
- // type: 'expedientes-pr',
- // funx: () => {
- // this.LoadCounts();
- // console.log('refresh with notification')
- // }
- // })
+ // this.NotificationsService.registerCallback({
+ // type:'despachos-pr',
+ // funx:() => {
+ // // this.LoadCounts();
+ // console.log('refresh with notification')
+ // }
+ // })
+ // this.NotificationsService.registerCallback({
+ // type:'expediente',
+ // funx: () => {
+ // this.LoadCounts();
+ // console.log('refresh with notification')
+ // }
+ // })
+ // this.NotificationsService.registerCallback({
+ // type:'gabinete-digital',
+ // funx:() => {
+ // this.LoadCounts();
+ // console.log('refresh with notification')
+ // }
+ // })
+ // this.NotificationsService.registerCallback({
+ // type:'parecer',
+ // funx: () => {
+ // this.LoadCounts();
+ // console.log('refresh with notification')
+ // }
+ // })
+ // this.NotificationsService.registerCallback({
+ // type: 'deferimento',
+ // funx: () => {
+ // this.LoadCounts();
+ // console.log('refresh with notification')
+ // }
+ // })
+ // this.NotificationsService.registerCallback({
+ // type: 'diplomas-assinar',
+ // funx: () => {
+ // this.LoadCounts();
+ // console.log('refresh with notification')
+ // }
+ // })
+ // this.NotificationsService.registerCallback({
+ // type: 'diplomas',
+ // funx: () => {
+ // this.LoadCounts();
+ // console.log('refresh with notification')
+ // }
+ // })
+ // this.NotificationsService.registerCallback({
+ // type: 'expedientes-pr',
+ // funx: () => {
+ // this.LoadCounts();
+ // console.log('refresh with notification')
+ // }
+ // })
+ }, 100);
+
}
async loadAllProcesses() {
diff --git a/src/app/services/notifications.service.ts b/src/app/services/notifications.service.ts
index b04c93800..07b39a581 100644
--- a/src/app/services/notifications.service.ts
+++ b/src/app/services/notifications.service.ts
@@ -12,6 +12,7 @@ import { EventTrigger } from '../services/eventTrigger.service';
import { SessionStore } from '../store/session.service';
import { ActionPerformed, PushNotificationSchema, PushNotifications, Token, } from '@capacitor/push-notifications';
import { notificationObject } from '../models/notifications';
+import { v4 as uuidv4 } from 'uuid'
@Injectable({
providedIn: 'root'
@@ -43,38 +44,41 @@ export class NotificationsService {
}
- // registerCallback({type, funx, id = uuidv4()} : {
- // type: notificationObject,
- // funx: Function
- // id?: string
- // }) {
- // this.callbacks[id] = { funx, id, type}
- // return id;
- // }
+ registerCallback({type, funx, id = uuidv4()} : {
+ type: notificationObject,
+ funx: Function
+ id?: string
+ }) {
+ this.callbacks[id] = { funx, id, type}
+ return id;
+ }
+ deleteCallback(id) {
+ delete this.callbacks[id]
+ }
- // private async runNotificationCallback(notification) {
+ private async runNotificationCallback(notification) {
- // for (const [key, value] of Object.entries(this.callbacks)) {
- // if(value.type == notification.data.Object) {
+ for (const [key, value] of Object.entries(this.callbacks)) {
+ if(value.type == notification.data.Object) {
- // const dontRepeat = await value.funx(notification)
+ const dontRepeat = await value.funx(notification)
- // if(dontRepeat) {
- // delete this.callbacks[key]
- // }
+ if(dontRepeat) {
+ delete this.callbacks[key]
+ }
- // } else if (value.type == '*') {
- // const dontRepeat = await value.funx(notification)
+ } else if (value.type == '*') {
+ const dontRepeat = await value.funx(notification)
- // if(dontRepeat) {
- // delete this.callbacks[key]
- // }
- // }
+ if(dontRepeat) {
+ delete this.callbacks[key]
+ }
+ }
- // }
+ }
- // }
+ }
getTokenByUserIdAndId(user, userID) {
// const geturl = environment.apiURL + 'notifications/user/' + userID;
diff --git a/version/git-version.ts b/version/git-version.ts
index ef949d992..ca0f1bb36 100644
--- a/version/git-version.ts
+++ b/version/git-version.ts
@@ -1,12 +1,12 @@
export let versionData = {
- "shortSHA": "cc9c5a9cf",
- "SHA": "cc9c5a9cf574d37b4d2269e37743f359bc1d7b8d",
+ "shortSHA": "b3a837927",
+ "SHA": "b3a83792766282081bb765748386258bca2bb08e",
"branch": "no_bug_movemente1",
"lastCommitAuthor": "'Peter Maquiran'",
- "lastCommitTime": "'Mon Jan 30 23:21:47 2023 +0100'",
+ "lastCommitTime": "'Wed Feb 1 09:08:46 2023 +0100'",
"lastCommitMessage": "fix",
- "lastCommitNumber": "4700",
+ "lastCommitNumber": "4701",
"change": "",
- "changeStatus": "On branch no_bug_movemente1\nChanges to be committed:\n (use \"git restore --staged ...\" to unstage)\n\tmodified: src/app/home/home.page.ts\n\tmodified: src/app/modals/document-detail/document-detail.page.html\n\tmodified: src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.ts\n\tmodified: src/app/pages/gabinete-digital/despachos-pr/despachos-pr.page.html\n\tmodified: src/app/pages/gabinete-digital/despachos-pr/despachos-pr.page.ts\n\tmodified: src/app/pages/gabinete-digital/despachos/despachos.page.html\n\tmodified: src/app/pages/gabinete-digital/diplomas-assinar/diplomas-assinar.page.ts\n\tmodified: src/app/pages/gabinete-digital/diplomas-gerar/diplomas-gerar.page.ts\n\tmodified: src/app/pages/gabinete-digital/diplomas/diplomas.page.ts\n\tmodified: src/app/pages/gabinete-digital/event-list/event-list.page.html\n\tmodified: src/app/pages/gabinete-digital/event-list/event-list.page.ts\n\tmodified: src/app/pages/gabinete-digital/expediente/expediente.page.html\n\tmodified: src/app/pages/gabinete-digital/expediente/expediente.page.ts\n\tmodified: src/app/pages/gabinete-digital/gabinete-digital.page.html\n\tmodified: src/app/pages/gabinete-digital/gabinete-digital.page.ts\n\tmodified: src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.html\n\tmodified: src/app/pages/gabinete-digital/pedidos/pedidos.page.html\n\tmodified: src/app/pages/gabinete-digital/pendentes/pendentes.page.html\n\tmodified: src/app/pages/gabinete-digital/pendentes/pendentes.page.ts\n\tmodified: src/app/services/chat/message.service.ts\n\tmodified: src/app/services/events.service.ts\n\tmodified: src/app/shared/agenda/event-list/event-list.page.ts\n\tmodified: src/app/shared/gabinete-digital/all-processes/all-processes.page.html\n\tmodified: src/app/shared/gabinete-digital/events-to-approve/events-to-approve.page.html\n\tmodified: src/app/shared/gabinete-digital/events-to-approve/events-to-approve.page.ts\n\tmodified: src/app/shared/popover/despachos-options/despachos-options.page.html\n\tmodified: src/app/shared/popover/event-details-documents-options/event-details-documents-options.page.html\n\tmodified: src/app/shared/popover/opts-expediente/opts-expediente.page.html\n\tmodified: src/app/shared/popover/opts-expediente/opts-expediente.page.ts\n\tmodified: src/app/shared/popover/request-options/request-options.page.html\n\tmodified: src/app/shared/popover/searched-document-options/searched-document-options.page.html\n\tmodified: src/environments/environment.ts\n\tmodified: version/git-version.ts",
+ "changeStatus": "On branch no_bug_movemente1\nChanges to be committed:\n (use \"git restore --staged ...\" to unstage)\n\tmodified: src/app/pages/gabinete-digital/gabinete-digital.page.html\n\tmodified: src/app/pages/gabinete-digital/gabinete-digital.page.ts\n\tmodified: src/app/services/notifications.service.ts",
"changeAuthor": "peter.maquiran"
}
\ No newline at end of file