From 4bdfab3b8c5631ace8a6fdb3977d21f2eec1f2a3 Mon Sep 17 00:00:00 2001 From: amsyarasyiq <82711525+amsyarasyiq@users.noreply.github.com> Date: Mon, 11 Mar 2024 09:54:33 +0800 Subject: [PATCH] Fix user profile editing crash when using custom themes --- src/lib/managers/themes.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lib/managers/themes.ts b/src/lib/managers/themes.ts index 85c4eca..a3897f5 100644 --- a/src/lib/managers/themes.ts +++ b/src/lib/managers/themes.ts @@ -41,6 +41,7 @@ export const color = findByProps("SemanticColor"); const appearanceManager = findByProps("updateTheme"); const mmkvStorage = findByProps("storage"); const ThemeStore = findByStoreName("ThemeStore"); +const formDividerModule = findByProps("DIVIDER_COLORS"); export const themes = wrapSync(createStorage>(createMMKVBackend("VENDETTA_THEMES"))); @@ -346,6 +347,10 @@ export function applyTheme(appliedTheme: Theme | null, fallbackTheme?: string, u if (appliedTheme) { color.Theme[vdKey.toUpperCase()] = vdKey; + formDividerModule.DIVIDER_COLORS = new Proxy(formDividerModule.DIVIDER_COLORS, { + get: (t, p, r) => p === vdKey && fallbackTheme ? t[fallbackTheme] : Reflect.get(t, p, r) + }); + Object.keys(color.Shadow).forEach(k => color.Shadow[k][vdKey] = color.Shadow[k][fallbackTheme!!]); Object.keys(color.SemanticColor).forEach(k => { color.SemanticColor[k][vdKey] = {