lil fix
This commit is contained in:
parent
3bdf403264
commit
d9b5cf9398
1 changed files with 3 additions and 1 deletions
|
|
@ -4,11 +4,13 @@ import { ReactNative as RN } from "@lib/preinit";
|
|||
import type { StyleSheet } from "react-native";
|
||||
|
||||
const ThemeStore = findByStoreName("ThemeStore");
|
||||
const colorResolver = findByProps("colors", "meta").meta;
|
||||
const colorModule = findByProps("colors", "unsafe_rawColors");
|
||||
const colorResolver = colorModule.internal ?? colorModule.meta;
|
||||
|
||||
// Reimplementation of Discord's createThemedStyleSheet, which was removed since 204201
|
||||
// Not exactly a 1:1 reimplementation, but sufficient to keep compatibility with existing plugins
|
||||
function createThemedStyleSheet<T extends StyleSheet.NamedStyles<T>>(sheet: T) {
|
||||
if (!colorModule) return;
|
||||
for (const key in sheet) {
|
||||
// @ts-ignore
|
||||
sheet[key] = new Proxy(RN.StyleSheet.flatten(sheet[key]), {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue