logo

pleroma-fe

My custom branche(s) on git.pleroma.social/pleroma/pleroma-fe git clone https://hacktivis.me/git/pleroma-fe.git
commit: fada49768dcd12faae4f7a188bdd36ea60f8b0a8
parent 914b4eb5938f00284afff3c210dcafa94e48f510
Author: Henry Jameson <me@hjkos.com>
Date:   Mon,  8 Mar 2021 21:14:03 +0200

extra protection to not write what we don't know

Diffstat:

Msrc/modules/config.js11++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/modules/config.js b/src/modules/config.js @@ -111,7 +111,16 @@ const config = { }, actions: { loadSettings ({ dispatch }, data) { - Object.keys(this.state.config).forEach( + const knownKeys = new Set(Object.keys(this.state.config)) + const presentKeys = new Set(Object.keys(data)) + const intersection = new Set() + for (let elem of presentKeys) { + if (knownKeys.has(elem)) { + intersection.add(elem) + } + } + + Object.keys(intersection).forEach( name => dispatch('setOption', { name, value: data[name] }) ) },