add isloading
gitea/salix-front/pipeline/head There was a failure building this commit
Details
gitea/salix-front/pipeline/head There was a failure building this commit
Details
This commit is contained in:
parent
9e0adce4f1
commit
88e8530b43
|
@ -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();
|
||||
}
|
||||
</script>
|
||||
<template>
|
||||
|
@ -269,7 +272,7 @@ async function toggleNotif(notif, chip) {
|
|||
</q-item-section>
|
||||
<q-item-section side top>
|
||||
<q-toggle
|
||||
:disable="!notif.allowed"
|
||||
:disable="!notif.allowed || isLoading"
|
||||
checked-icon="check"
|
||||
unchecked-icon="close"
|
||||
indeterminate-icon="block"
|
||||
|
|
Loading…
Reference in New Issue