[Themes] Hook native colors earlier
This commit is contained in:
parent
0619eaa176
commit
815d03d03d
1 changed files with 11 additions and 4 deletions
|
|
@ -89,10 +89,6 @@ class LoadHook: ClassHook<RCTCxxBridge> {
|
|||
{
|
||||
orig.executeApplicationScript(
|
||||
"globalThis.__vendetta_theme=\(themeString)".data(using: .utf8)!, url: source, async: false)
|
||||
let theme = try? JSONDecoder().decode(Theme.self, from: themeString.data(using: .utf8)!)
|
||||
if let semanticColors = theme?.data.semanticColors { swizzleDCDThemeColor(semanticColors) }
|
||||
if let rawColors = theme?.data.rawColors { swizzleUIColor(rawColors) }
|
||||
|
||||
}
|
||||
|
||||
if vendetta != nil {
|
||||
|
|
@ -103,3 +99,14 @@ class LoadHook: ClassHook<RCTCxxBridge> {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct VendettaTweak: Tweak {
|
||||
func tweakDidActivate() {
|
||||
if let themeData = try? Data(
|
||||
contentsOf: documentDirectory.appendingPathComponent("vendetta_theme.json")) {
|
||||
let theme = try? JSONDecoder().decode(Theme.self, from: themeData)
|
||||
if let semanticColors = theme?.data.semanticColors { swizzleDCDThemeColor(semanticColors) }
|
||||
if let rawColors = theme?.data.rawColors { swizzleUIColor(rawColors) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue