forked from AkkomaGang/admin-fe
Merge pull request 'Fix :mime, :extensions freaking out adminfe' (#22) from develop into stable
Reviewed-on: AkkomaGang/admin-fe#22
This commit is contained in:
commit
fe5fac5fdf
2 changed files with 5 additions and 3 deletions
|
@ -37,7 +37,7 @@ const getValueWithoutKey = (key, [type, value]) => {
|
|||
updatedArray[index] = { 'tuple': ['ExSyslogger', ':ex_syslogger'] }
|
||||
}
|
||||
return updatedArray
|
||||
} else if (key === ':types') {
|
||||
} else if ([':types', ':extensions'].includes(key)) {
|
||||
return Object.keys(value).reduce((acc, key) => { return { ...acc, [key]: value[key][1] } }, {})
|
||||
}
|
||||
return value
|
||||
|
@ -186,7 +186,7 @@ export const processNested = (valueForState, valueForUpdatedSettings, group, par
|
|||
...{ [key]: [type, valueForUpdatedSettings] }}
|
||||
: { [key]: [type, valueForUpdatedSettings] }
|
||||
|
||||
if (group === ':mime' && parents[0].key === ':types') {
|
||||
if (group === ':mime' && [':types', ':extensions'].includes(parents[0].key)) {
|
||||
updatedValueForState = settings[group][parents[0].key]
|
||||
? { ...settings[group][parents[0].key].value, ...updatedValueForState }
|
||||
: updatedValueForState
|
||||
|
@ -229,6 +229,7 @@ export const valueHasTuples = (key, value) => {
|
|||
const valueIsArrayOfNonObjects = Array.isArray(value) && value.length > 0 && value.every(el => typeof el !== 'object')
|
||||
return key === ':meta' ||
|
||||
key === ':types' ||
|
||||
key === ':extensions' ||
|
||||
key === ':backends' ||
|
||||
key === ':compiled_template_engines' ||
|
||||
key === ':compiled_format_encoders' ||
|
||||
|
|
|
@ -120,7 +120,8 @@ const settings = {
|
|||
const searchObject = formSearchObject(data)
|
||||
commit('SET_SEARCH', searchObject)
|
||||
commit('SET_TABS', tabs)
|
||||
} catch (_e) {
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
commit('TOGGLE_TABS', true)
|
||||
commit('SET_LOADING', false)
|
||||
return
|
||||
|
|
Loading…
Reference in a new issue