Fix for infinite reload in mime picker when automatic update is enabled

This commit is contained in:
2022-01-22 13:30:48 -05:00
parent 727b57b78a
commit b799a2e976
5 changed files with 27 additions and 16 deletions

View File

@@ -16,7 +16,8 @@ export default {
data() {
return {
mimeTree: null,
stashedMimeTreeAttributes: null
stashedMimeTreeAttributes: null,
updateBusy: false
}
},
mounted() {
@@ -34,6 +35,10 @@ export default {
return;
}
if (this.updateBusy) {
return;
}
this.$store.commit("setSelectedMimeTypes", getSelectedTreeNodes(this.mimeTree));
},
updateTree() {
@@ -42,6 +47,11 @@ export default {
return;
}
if (this.updateBusy) {
return
}
this.updateBusy = true;
if (this.stashedMimeTreeAttributes === null) {
this.stashedMimeTreeAttributes = getTreeNodeAttributes(this.mimeTree);
}
@@ -78,6 +88,7 @@ export default {
}
});
this.stashedMimeTreeAttributes = null;
this.updateBusy = false;
});
},