Config: Improve loading in frontend

Signed-off-by: Michael Mayer <michael@liquidbytes.net>
This commit is contained in:
Michael Mayer 2020-12-25 22:53:18 +01:00
parent 4cc812fc65
commit e0db3eb68c
5 changed files with 12 additions and 12 deletions

View file

@ -77,12 +77,12 @@ export default class Config {
}
}
ready() {
return this.values.mode && this.values.mode !== "public";
loading() {
return !this.values.mode || this.values.mode === "public";
}
wait() {
if (!this.ready()) {
load() {
if (this.loading()) {
return this.update();
}

View file

@ -106,7 +106,7 @@ export default {
const root = {"path": "/", "name": this.$gettext("All files from import folder")};
return {
ready: this.$config.ready(),
ready: !this.$config.loading(),
settings: new Settings(this.$config.settings()),
started: false,
busy: false,
@ -128,7 +128,7 @@ export default {
},
methods: {
load() {
this.$config.wait().then(() => {
this.$config.load().then(() => {
this.settings.setValues(this.$config.settings());
this.dirs = [this.root];

View file

@ -101,7 +101,7 @@ export default {
const root = {"path": "/", "name": this.$gettext("All originals")}
return {
ready: this.$config.ready(),
ready: !this.$config.loading(),
settings: new Settings(this.$config.settings()),
readonly: this.$config.get("readonly"),
config: this.$config.values,
@ -119,7 +119,7 @@ export default {
},
methods: {
load() {
this.$config.wait().then(() => {
this.$config.load().then(() => {
this.settings.setValues(this.$config.settings());
this.dirs = [this.root];

View file

@ -289,7 +289,7 @@ export default {
config: this.$config.values,
settings: new Settings(this.$config.settings()),
options: options,
busy: this.$config.ready(),
busy: this.$config.loading(),
subscriptions: [],
};
},
@ -304,7 +304,7 @@ export default {
},
methods: {
load() {
this.$config.wait().then(() => {
this.$config.load().then(() => {
this.settings.setValues(this.$config.settings());
this.busy = false;
})

View file

@ -141,7 +141,7 @@ export default {
config: this.$config.values,
settings: new Settings(this.$config.settings()),
options: options,
busy: this.$config.ready(),
busy: this.$config.loading(),
subscriptions: [],
};
},
@ -156,7 +156,7 @@ export default {
},
methods: {
load() {
this.$config.wait().then(() => {
this.$config.load().then(() => {
this.settings.setValues(this.$config.settings());
this.busy = false;
})