From fe16b08dbfe786eff1ff73eea77337eb8e67492b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Jagie=C5=82=C5=82o?= Date: Thu, 13 Jan 2022 02:53:08 +0100 Subject: [PATCH 1/2] Fix bug in settings parser (and change one name which had cyrillic letter instead of latin C for some reason) --- src/store/modules/normalizers.js | 10 +++++----- src/views/layout/components/Sidebar/index.vue | 7 ++++++- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/store/modules/normalizers.js b/src/store/modules/normalizers.js index d286f379..cb003a79 100644 --- a/src/store/modules/normalizers.js +++ b/src/store/modules/normalizers.js @@ -28,7 +28,7 @@ const getCurrentValue = (type, value, path) => { } const getValueWithoutKey = (key, [type, value]) => { - if (prependWithСolon(type, value)) { + if (prependWithColon(type, value)) { return `:${value}` } else if (key === ':backends') { const index = value.findIndex(el => el === ':ex_syslogger') @@ -113,8 +113,8 @@ export const parseTuples = (tuples, key) => { accum[item.tuple[0]] = parseNonTuples(item.tuple[0], item.tuple[1]) } else if (item.tuple[0] === ':ip_whitelist') { accum[item.tuple[0]] = item.tuple[1].map(ip => typeof ip === 'string' ? ip : ip.tuple.join('.')) - } else if (Array.isArray(item.tuple[1]) && - (typeof item.tuple[1][0] === 'object' && !Array.isArray(item.tuple[1][0])) && item.tuple[1][0]['tuple']) { + } else if (Array.isArray(item.tuple[1]) && (item.tuple[1][0] !== null && + typeof item.tuple[1][0] === 'object' && !Array.isArray(item.tuple[1][0])) && item.tuple[1][0]['tuple']) { accum[item.tuple[0]] = parseTuples(item.tuple[1], item.tuple[0]) } else if (Array.isArray(item.tuple[1])) { accum[item.tuple[0]] = item.tuple[1] @@ -167,7 +167,7 @@ const parseStringOrTupleValue = (key, value) => { } } -const prependWithСolon = (type, value) => { +const prependWithColon = (type, value) => { return (type === 'atom' && value.length > 0) || (Array.isArray(type) && type.includes('boolean') && type.includes('atom') && typeof value === 'string') } @@ -256,7 +256,7 @@ const wrapValues = (settings, currentState) => { )) ) { return { 'tuple': [setting, wrapValues(value, currentState)] } - } else if (prependWithСolon(type, value)) { + } else if (prependWithColon(type, value)) { return { 'tuple': [setting, `:${value}`] } } else if (type.includes('tuple') && (type.includes('string') || type.includes('atom') || type.includes('boolean'))) { diff --git a/src/views/layout/components/Sidebar/index.vue b/src/views/layout/components/Sidebar/index.vue index f57ebf17..ed8bd849 100644 --- a/src/views/layout/components/Sidebar/index.vue +++ b/src/views/layout/components/Sidebar/index.vue @@ -55,7 +55,12 @@ export default { }, async handleOpen($event) { if ($event === '/settings') { - if (!localStorage.getItem('settingsTabs')) { + let settingsTabs = localStorage.getItem('settingsTabs') + if (settingsTabs === '[]') { + localStorage.removeItem('settingsTabs') + settingsTabs = null + } + if (!settingsTabs) { await this.$store.dispatch('FetchSettings') const menuItems = this.tabs localStorage.setItem('settingsTabs', JSON.stringify(menuItems)) -- GitLab From d1105a77b3744246eea455a3259f7ca9dbbe6eca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Jagie=C5=82=C5=82o?= Date: Sun, 13 Mar 2022 14:29:15 +0100 Subject: [PATCH 2/2] Update package.json repository URL --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 3339f015..3902687b 100644 --- a/package.json +++ b/package.json @@ -29,13 +29,13 @@ ], "repository": { "type": "git", - "url": "git+https://github.com/PanJiaChen/vue-element-admin.git" + "url": "git+https://git.pleroma.social/pleroma/admin-fe.git" }, "resolutions": { "prosemirror-model": "1.18.1" }, "bugs": { - "url": "https://github.com/PanJiaChen/vue-element-admin/issues" + "url": "https://git.pleroma.social/pleroma/admin-fe/-/issues" }, "dependencies": { "@babel/runtime": "7.18.9", -- GitLab