diff --git a/src/pages/Worker/Card/WorkerNotificationsManager.vue b/src/pages/Worker/Card/WorkerNotificationsManager.vue index ef63ec434..37a0bb5c6 100644 --- a/src/pages/Worker/Card/WorkerNotificationsManager.vue +++ b/src/pages/Worker/Card/WorkerNotificationsManager.vue @@ -50,8 +50,10 @@ const workerFilter = { }; const notificationAcls = ref([]); +const isLoading = ref(false); async function fetch() { + isLoading.value = true; const { data } = await axios.get(`Workers/${entityId.value}`, { params: { filter: JSON.stringify(workerFilter), @@ -168,6 +170,7 @@ async function fetch() { } worker.value = data; + isLoading.value = false; } function sortNotifs() { @@ -193,7 +196,7 @@ async function toggleNotif(notif, chip) { notif.active = !notif.active; } if (notif.active) { - let notificationSubscription = await axios.post( + await axios.post( `NotificationSubscriptions`, { notificationFk: notif.id, @@ -205,7 +208,6 @@ async function toggleNotif(notif, chip) { }, } ); - worker.value.subscribedNotifs.push(notificationSubscription.data); quasar.notify({ type: 'positive', message: t('worker.notificationsManager.subscribed'), @@ -227,6 +229,7 @@ async function toggleNotif(notif, chip) { message: t('worker.notificationsManager.unsubscribed'), }); } + await fetch(); }