From 96a38c6fed586351579e67d677d23a00c7c600fe Mon Sep 17 00:00:00 2001 From: ioj4 <69911332+ioj4@users.noreply.github.com> Date: Thu, 8 Aug 2024 17:36:35 +0200 Subject: [PATCH] [snazzy-shelter] fix store not getting updated repro: enable a theme, disable it, reload discord -> theme is still enabled --- plugins/snazzy-shelter/src/util/themeLoadUtil.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/snazzy-shelter/src/util/themeLoadUtil.js b/plugins/snazzy-shelter/src/util/themeLoadUtil.js index a88fcc4..69c821e 100644 --- a/plugins/snazzy-shelter/src/util/themeLoadUtil.js +++ b/plugins/snazzy-shelter/src/util/themeLoadUtil.js @@ -20,11 +20,11 @@ export async function loadTheme(theme) { delete toPush.CSS; toPush.enabled = true; - if (themeCacheIndex === -1) store.themes = [...store.themes, toPush]; + if (themeCacheIndex === -1) store.themes.push(toPush); else store.themes[themeCacheIndex] = toPush; // trigger set event - //store.themes = store.themes; + store.themes = store.themes; } export function unloadTheme(theme) { @@ -38,11 +38,11 @@ export function unloadTheme(theme) { const themeCacheIndex = store.themes.findIndex((t) => t.url === theme.url); let toPush = { ...theme }; toPush.enabled = false; - if (themeCacheIndex === -1) store.themes = [...store.themes, toPush]; + if (themeCacheIndex === -1) store.themes.push(toPush); else store.themes[themeCacheIndex] = toPush; // trigger set event - // store.themes = store.themes; + store.themes = store.themes; } export function removeTheme(theme) {