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: 89b916da288abff19cb82f3330a94e904992d63a
parent a7e1ce20bff8141640d55a914ec8dc04f5141322
Author: Henry Jameson <me@hjkos.com>
Date:   Thu, 28 Nov 2024 18:07:22 +0200

fixes for clean state

Diffstat:

Msrc/boot/after_store.js2++
Msrc/modules/instance.js2++
Msrc/modules/interface.js8+++++---
3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/boot/after_store.js b/src/boot/after_store.js @@ -123,6 +123,8 @@ const setSettings = async ({ apiConfig, staticConfig, store }) => { } copyInstanceOption('theme') + copyInstanceOption('style') + copyInstanceOption('palette') copyInstanceOption('nsfwCensorImage') copyInstanceOption('background') copyInstanceOption('hidePostStats') diff --git a/src/modules/instance.js b/src/modules/instance.js @@ -99,6 +99,8 @@ const defaultState = { sidebarRight: false, subjectLineBehavior: 'email', theme: 'pleroma-dark', + palette: null, + style: null, emojiReactionsScale: 0.5, textSize: '14px', emojiSize: '2.2rem', diff --git a/src/modules/interface.js b/src/modules/interface.js @@ -331,7 +331,7 @@ const interfaceMod = { } else { result.nameUsed = name - if (result.nameUsed === 'stock') { + if (result.nameUsed == null) { result.dataUsed = null return result } @@ -448,8 +448,10 @@ const interfaceMod = { ) state.paletteNameUsed = palette.nameUsed state.paletteDataUsed = palette.dataUsed - state.paletteDataUsed.link = state.paletteDataUsed.link || state.paletteDataUsed.accent - state.paletteDataUsed.accent = state.paletteDataUsed.accent || state.paletteDataUsed.link + if (state.paletteDataUsed) { + state.paletteDataUsed.link = state.paletteDataUsed.link || state.paletteDataUsed.accent + state.paletteDataUsed.accent = state.paletteDataUsed.accent || state.paletteDataUsed.link + } if (Array.isArray(state.paletteDataUsed)) { const [ name,