remove diplomas para assinar

This commit is contained in:
Peter Maquiran
2023-02-01 11:08:41 +01:00
parent b3a8379276
commit 189ec6e917
4 changed files with 111 additions and 104 deletions
+27 -23
View File
@@ -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;