This commit is contained in:
@@ -7,7 +7,7 @@ const MAX_POLLING_INTERVAL = 15 * 60 * 1000; //15 minutes maximum wait time
|
|||||||
export default {
|
export default {
|
||||||
async startPolling() {
|
async startPolling() {
|
||||||
keepPolling = true;
|
keepPolling = true;
|
||||||
let pollingInterval = DEFAULT_POLLING_INTERVAL;
|
let pollingInterval = window.$gz.dev ? 20000 : DEFAULT_POLLING_INTERVAL;
|
||||||
try {
|
try {
|
||||||
while (keepPolling == true) {
|
while (keepPolling == true) {
|
||||||
let status = await window.$gz.api.get("notify/new-count");
|
let status = await window.$gz.api.get("notify/new-count");
|
||||||
@@ -16,7 +16,7 @@ export default {
|
|||||||
}
|
}
|
||||||
window.$gz.store.commit("setNewNotificationCount", status.data);
|
window.$gz.store.commit("setNewNotificationCount", status.data);
|
||||||
//success so go to default in case it was changed by an error
|
//success so go to default in case it was changed by an error
|
||||||
pollingInterval = DEFAULT_POLLING_INTERVAL;
|
pollingInterval = window.$gz.dev ? 20000 : DEFAULT_POLLING_INTERVAL;
|
||||||
await window.$gz.util.sleepAsync(pollingInterval);
|
await window.$gz.util.sleepAsync(pollingInterval);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@@ -89,7 +89,31 @@ export default {
|
|||||||
id: item.notifySubscriptionId
|
id: item.notifySubscriptionId
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
deleteItem(item) {},
|
async deleteItem(item) {
|
||||||
|
//prompt
|
||||||
|
//delete
|
||||||
|
|
||||||
|
let vm = this;
|
||||||
|
try {
|
||||||
|
let dialogResult = await window.$gz.dialog.confirmDelete();
|
||||||
|
if (dialogResult != true) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
window.$gz.form.deleteAllErrorBoxErrors(vm);
|
||||||
|
let res = await window.$gz.api.upsert(
|
||||||
|
`notify/${item.id}`,
|
||||||
|
this.selectedItems
|
||||||
|
);
|
||||||
|
if (res.error) {
|
||||||
|
vm.formState.serverError = res.error;
|
||||||
|
window.$gz.form.setErrorBoxErrors(vm);
|
||||||
|
}
|
||||||
|
this.reload = !this.reload;
|
||||||
|
} catch (ex) {
|
||||||
|
window.$gz.errorHandler.handleFormError(ex, vm);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
async getDataFromApi() {
|
async getDataFromApi() {
|
||||||
let vm = this;
|
let vm = this;
|
||||||
@@ -267,7 +291,8 @@ async function initForm(vm) {
|
|||||||
async function fetchTranslatedText(vm) {
|
async function fetchTranslatedText(vm) {
|
||||||
await window.$gz.translation.cacheTranslations([
|
await window.$gz.translation.cacheTranslations([
|
||||||
"NotifySubscription",
|
"NotifySubscription",
|
||||||
"Server"
|
"Server",
|
||||||
|
"Notifications"
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user