Frontend: Disable route when PHOTOPRISM_SETTINGS_HIDDEN is true #474

Signed-off-by: Michael Mayer <michael@liquidbytes.net>
This commit is contained in:
Michael Mayer 2020-08-19 12:45:26 +02:00
parent c5beaeaddb
commit b3bb2883fc
2 changed files with 22 additions and 0 deletions

View file

@ -268,6 +268,13 @@ export default [
component: Settings,
meta: {title: $gettext("Settings"), auth: true, background: "application-light"},
props: {tab: 0},
beforeEnter: (to, from, next) => {
if (c.disableSettings) {
next({name: "home"});
} else {
next();
}
},
},
{
name: "settings_sync",
@ -275,6 +282,13 @@ export default [
component: Settings,
meta: {title: $gettext("Settings"), auth: true, background: "application-light"},
props: {tab: 1},
beforeEnter: (to, from, next) => {
if (c.disableSettings) {
next({name: "home"});
} else {
next();
}
},
},
{
name: "settings_account",
@ -282,6 +296,13 @@ export default [
component: Settings,
meta: {title: $gettext("Settings"), auth: true, background: "application-light"},
props: {tab: 2},
beforeEnter: (to, from, next) => {
if (c.disableSettings) {
next({name: "home"});
} else {
next();
}
},
},
{
name: "discover",

View file

@ -136,6 +136,7 @@ func (c *Config) PublicConfig() ClientConfig {
Copyright: c.Copyright(),
Debug: c.Debug(),
ReadOnly: c.ReadOnly(),
DisableSettings: c.SettingsHidden(),
Public: c.Public(),
Experimental: c.Experimental(),
Thumbs: Thumbs,