logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://anongit.hacktivis.me/git/pleroma-fe.git/
commit: 7b56b3f411d0f32fa9221d8ba5a6843a69826777
parent 00438e852e6b629f539c6154f80a03d4c87b4d45
Author: Henry Jameson <me@hjkos.com>
Date:   Mon, 25 Nov 2024 19:42:50 +0200

more predictable styles order, custom styles before builtins

Diffstat:

Msrc/components/settings_modal/tabs/appearance_tab.js13++++++++++---
Msrc/services/style_setter/style_setter.js2+-
2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/src/components/settings_modal/tabs/appearance_tab.js b/src/components/settings_modal/tabs/appearance_tab.js @@ -34,7 +34,8 @@ library.add( const AppearanceTab = { data () { return { - availableStyles: [], + availableThemesV3: [], + availableThemesV2: [], bundledPalettes: [], compilationCache: {}, fileImporter: newImporter({ @@ -108,13 +109,13 @@ const AppearanceTab = { updateIndex('style').then(styles => { styles.forEach(([key, stylePromise]) => stylePromise.then(data => { const meta = data.find(x => x.component === '@meta') - this.availableStyles.push({ key, data, name: meta.directives.name, version: 'v3' }) + this.availableThemesV3.push({ key, data, name: meta.directives.name, version: 'v3' }) })) }) updateIndex('theme').then(themes => { themes.forEach(([key, themePromise]) => themePromise.then(data => { - this.availableStyles.push({ key, data, name: data.name, version: 'v2' }) + this.availableThemesV2.push({ key, data, name: data.name, version: 'v2' }) })) }) @@ -169,6 +170,12 @@ const AppearanceTab = { }) }, computed: { + availableStyles () { + return [ + ...this.availableThemesV3, + ...this.availableThemesV2 + ] + }, availablePalettes () { return [ ...this.bundledPalettes, diff --git a/src/services/style_setter/style_setter.js b/src/services/style_setter/style_setter.js @@ -275,7 +275,7 @@ export const getResourcesIndex = async (url, parser = JSON.parse) => { console.warn(`Custom resources at ${customUrl} unavailable`) } - const total = [...builtin, ...custom] + const total = [...custom, ...builtin] if (total.length === 0) { return Promise.reject(new Error(`Resource at ${url} and ${customUrl} completely unavailable. Panicking`)) }