replace tmpLoading with an abortcontroller

This commit is contained in:
chfhtw
2026-04-20 15:22:52 +02:00
parent 239577e9cf
commit 28d65ac114
@@ -17,7 +17,7 @@ export default {
funktionen: {},
sections: [],
selectedFunktionen: [],
tmpLoading: ''
abortController: null
};
},
computed: {
@@ -130,20 +130,21 @@ export default {
.catch(this.$fhcAlert.handleSystemError);
},
loadSections() {
let funktionen = this.selectedFunktionen;
this.sections = [];
this.tmpLoading = funktionen.join('###');
const params = {
db: this.dashboard,
funktionen
funktionen: this.selectedFunktionen
};
if (this.abortController)
this.abortController.abort();
this.abortController = new AbortController();
const signal = this.abortController.signal;
this.sections = [];
return this.$api
.call(ApiDashboardPreset.getBatch(params))
.call(ApiDashboardPreset.getBatch(params), { signal })
.then(result => {
if (this.tmpLoading !== funktionen.join('###'))
return; // NOTE(chris): prevent race condition
for (var section in result.data) {
let widgets = [];
for (var wid in result.data[section]) {