From 7b3ede19041bdaa3c550c07d771a2ba9577a50ec Mon Sep 17 00:00:00 2001 From: PalmDevs Date: Tue, 19 Aug 2025 21:46:32 +0700 Subject: [PATCH] chore(lib/react/native/patches): refactor to one `instead` patch --- lib/react/src/native/patches.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/react/src/native/patches.ts b/lib/react/src/native/patches.ts index bf69a17..830344b 100644 --- a/lib/react/src/native/patches.ts +++ b/lib/react/src/native/patches.ts @@ -1,19 +1,17 @@ -import { after, before } from '@revenge-mod/patcher' +import { instead } from '@revenge-mod/patcher' import { ReactNative } from '..' import { sAfterRunApplication, sBeforeRunApplication } from './_internal' -before(ReactNative.AppRegistry, 'runApplication', args => { +instead(ReactNative.AppRegistry, 'runApplication', function (args, orig) { for (const cb of sBeforeRunApplication) try { cb() } catch {} - return args -}) -after(ReactNative.AppRegistry, 'runApplication', res => { + Reflect.apply(orig, this, args) + for (const cb of sAfterRunApplication) try { cb() } catch {} - return res })