fix invalid option copy
This commit is contained in:
parent
095abb2914
commit
912aa228d1
9 changed files with 42 additions and 58 deletions
|
|
@ -162,17 +162,17 @@ const setSettings = async ({ apiConfig, staticConfig, store }) => {
|
|||
config = Object.assign({}, staticConfig, apiConfig)
|
||||
}
|
||||
|
||||
const copyInstanceOption = (path) => {
|
||||
if (typeof config[name] !== 'undefined') {
|
||||
useInstanceStore().set({ path, value: config[name] })
|
||||
const copyInstanceOption = ({ source, destination }) => {
|
||||
if (typeof config[source] !== 'undefined') {
|
||||
useInstanceStore().set({ path: destination, value: config[source] })
|
||||
}
|
||||
}
|
||||
|
||||
Object.keys(staticOrApiConfigDefault)
|
||||
.map((k) => `instanceIdentity.${k}`)
|
||||
.map((k) => ({ source: k, destination: `instanceIdentity.${k}`}))
|
||||
.forEach(copyInstanceOption)
|
||||
Object.keys(instanceDefaultConfig)
|
||||
.map((k) => `prefsStorage.${k}`)
|
||||
.map((k) => ({ source: k, destination: `prefsStorage.${k}`}))
|
||||
.forEach(copyInstanceOption)
|
||||
|
||||
useAuthFlowStore().setInitialStrategy(config.loginMethod)
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ export default (store) => {
|
|||
if (store.state.users.currentUser) {
|
||||
next()
|
||||
} else {
|
||||
next(useInstanceStore().redirectRootNoLogin || '/main/all')
|
||||
next(useInstanceStore().instanceIdentity.redirectRootNoLogin || '/main/all')
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -49,8 +49,8 @@ export default (store) => {
|
|||
redirect: () => {
|
||||
return (
|
||||
(store.state.users.currentUser
|
||||
? useInstanceStore().redirectRootLogin
|
||||
: useInstanceStore().redirectRootNoLogin) || '/main/all'
|
||||
? useInstanceStore().instanceIdentity.redirectRootLogin
|
||||
: useInstanceStore().instanceIdentity.redirectRootNoLogin) || '/main/all'
|
||||
)
|
||||
},
|
||||
},
|
||||
|
|
@ -201,7 +201,7 @@ export default (store) => {
|
|||
},
|
||||
]
|
||||
|
||||
if (useInstanceStore().pleromaChatMessagesAvailable) {
|
||||
if (useInstanceStore().featureSet.pleromaChatMessagesAvailable) {
|
||||
routes = routes.concat([
|
||||
{
|
||||
name: 'chat',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue