UX: Prevent unnecessary transition when loading Settings

Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
Michael Mayer 2022-10-22 22:51:57 +02:00
parent e8d11deb49
commit 4232a02a4f
3 changed files with 19 additions and 1 deletions

View file

@ -108,6 +108,10 @@ export default {
active = tabs.findIndex((t) => t.name === this.tab);
}
if (active < 0) {
active = 0;
}
return {
tabs: tabs,
demo: isDemo,

View file

@ -70,13 +70,23 @@ export default {
});
}
let active = 0;
if (typeof this.$route.name === 'string' && this.$route.name !== '') {
active = tabs.findIndex((t) => t.name === this.$route.name);
}
if (active < 0) {
active = 0;
}
return {
tabs: tabs,
demo: isDemo,
public: isPublic,
config: config,
readonly: isReadOnly,
active: 0,
active: active,
rtl: this.$rtl,
};
},

View file

@ -137,6 +137,10 @@ export default {
active = tabs.findIndex((t) => t.name === this.tab);
}
if (active < 0) {
active = 0;
}
return {
tabs: tabs,
demo: isDemo,