mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 13:02:56 +00:00
remove diplomas para assinar
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user