Fix user profile editing crash
when using custom themes
This commit is contained in:
parent
51262dae00
commit
4bdfab3b8c
1 changed files with 5 additions and 0 deletions
|
|
@ -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<Record<string, Theme>>(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] = {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue