From 9e0adce4f117c324282e43483462f4206e21fdd5 Mon Sep 17 00:00:00 2001 From: Pau Navarro Date: Wed, 18 Jan 2023 08:23:51 +0100 Subject: [PATCH] fix error not being able to unsubscribe instantly --- src/pages/Worker/Card/WorkerNotificationsManager.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/Worker/Card/WorkerNotificationsManager.vue b/src/pages/Worker/Card/WorkerNotificationsManager.vue index 9be2e4527..ef63ec434 100644 --- a/src/pages/Worker/Card/WorkerNotificationsManager.vue +++ b/src/pages/Worker/Card/WorkerNotificationsManager.vue @@ -193,7 +193,7 @@ async function toggleNotif(notif, chip) { notif.active = !notif.active; } if (notif.active) { - await axios.post( + let notificationSubscription = await axios.post( `NotificationSubscriptions`, { notificationFk: notif.id, @@ -205,6 +205,7 @@ async function toggleNotif(notif, chip) { }, } ); + worker.value.subscribedNotifs.push(notificationSubscription.data); quasar.notify({ type: 'positive', message: t('worker.notificationsManager.subscribed'),