diff --git a/lib/discord/src/common/index.ts b/lib/discord/src/common/index.ts index af78183..ded53a0 100644 --- a/lib/discord/src/common/index.ts +++ b/lib/discord/src/common/index.ts @@ -25,8 +25,6 @@ export const [Tokens, TokensModuleId] = lookupModule(withProps('RawColor')) as [ Metro.ModuleID, ] -const OnlyImportTrackerDep = [2] - /** * If you need to use this ID, unproxify {@link Constants} first. * @@ -49,10 +47,10 @@ export let Constants: DiscordModules.Constants = proxify( withDependencies( loose([ null, - relative.withDependencies(OnlyImportTrackerDep, 1), - relative.withDependencies(OnlyImportTrackerDep, 2), - relative.withDependencies(OnlyImportTrackerDep, 3), - relative.withDependencies(OnlyImportTrackerDep, 4), + relative.withDependencies([2], 1), + relative.withDependencies([2], 2), + relative.withDependencies([2], 3), + relative.withDependencies([2], 4), ]), ), ), diff --git a/lib/discord/src/design.ts b/lib/discord/src/design.ts index 06b818d..ccafe56 100644 --- a/lib/discord/src/design.ts +++ b/lib/discord/src/design.ts @@ -20,27 +20,39 @@ export let Design: Design = proxify( // ID: 3236 // [3237, 1366, 3238, 3239, 2, ...]; const [module] = lookupModule( - withProps('TableRow', 'Button').and( - withDependencies( - loose([ - null, - null, - null, - relative.withDependencies([2], 1), - 2, - null, // 3009 - null, // 3010 - null, // 3011 - null, // 3012 - relative.withDependencies([2], 2), - ]), - ).or( - // TODO(PalmDevs): Remove once stable channel is > 295203 (for 295203 and below) + withProps('TableRow', 'Button') + .and( withDependencies( - loose([relative(1), null, relative(2), relative(3), 2]), + loose([ + null, + null, + relative.withDependencies( + [ReactNativeModuleId, 2], + 1, + ), + relative.withDependencies([2], 2), + 2, + ]), + ).or( + // TODO(PalmDevs): Remove once stable channel is > 297201 (for 297201 and below) + withDependencies( + loose([ + null, + null, + null, + relative.withDependencies([2], 1), + 2, + null, // 3009 + null, // 3010 + null, // 3011 + null, // 3012 + relative.withDependencies([2], 2), + ]), + ), ), - ), - ), + ) + .keyAs('revenge.discord.design.Design'), + { uninitialized: true, }, diff --git a/lib/discord/src/modules/main_tabs_v2.ts b/lib/discord/src/modules/main_tabs_v2.ts index 3b23e13..8bf4d19 100644 --- a/lib/discord/src/modules/main_tabs_v2.ts +++ b/lib/discord/src/modules/main_tabs_v2.ts @@ -18,12 +18,20 @@ export interface RootNavigationRef { export let RootNavigationRef: RootNavigationRef = proxify( () => { const [module] = lookupModule( - withProps('getRootNavigationRef').and( - withDependencies([ - loose([[], loose([relative(1), relative(2)])]), - 2, - ]), - ), + withProps('getRootNavigationRef') + .and( + withDependencies([ + loose([ + relative.withDependencies([], 1), + relative.withDependencies( + loose([relative(1), relative(2)]), + 2, + ), + ]), + 2, + ]), + ) + .keyAs('revenge.discord.modules.mainTabsV2.RootNavigationRef'), { uninitialized: true, }, diff --git a/lib/externals/src/react-navigation.ts b/lib/externals/src/react-navigation.ts index 6e17cab..e23faa1 100644 --- a/lib/externals/src/react-navigation.ts +++ b/lib/externals/src/react-navigation.ts @@ -41,23 +41,26 @@ export let ReactNavigationNative: typeof import('@react-navigation/native') = export let ReactNavigationStack: typeof import('@react-navigation/stack') = proxify( () => { + const firstDep = relative.withDependencies( + loose([[[]], ReactModuleId, ReactJSXRuntimeModuleId]), + 1, + ) + const [module] = lookupModule( - withProps('StackView').and( - withDependencies( - loose([ - relative.withDependencies( - loose([ - [[]], - ReactModuleId, - ReactJSXRuntimeModuleId, - ]), - 1, + withProps('StackView') + .and( + withDependencies( + loose([firstDep, null, relative(2)]), + ).or( + // TODO: Remove once stable channel is > 297201 (for 297201 and below) + withDependencies( + loose([firstDep, null, relative(3)]), ), - null, - relative(3), - ]), + ), + ) + .keyAs( + 'revenge.externals.ReactNavigation.ReactNavigationStack', ), - ), { uninitialized: true, },