diff --git a/lib/discord/src/common/flux.ts b/lib/discord/src/common/flux.ts index 6e17f11..5b98420 100644 --- a/lib/discord/src/common/flux.ts +++ b/lib/discord/src/common/flux.ts @@ -11,7 +11,7 @@ import { } from '@revenge-mod/modules/finders/lookup' import { waitForModules } from '@revenge-mod/modules/finders/wait' import { getModuleDependencies } from '@revenge-mod/modules/metro/utils' -import { noop } from '@revenge-mod/utils/callback' +import { asap, noop } from '@revenge-mod/utils/callback' import { cached, cacheFilterResultForId } from '../../../modules/src/caches' import { FilterResultFlags } from '../../../modules/src/finders/_internal' import type { @@ -162,7 +162,7 @@ waitForModules(byStore(), (store, id) => { cached.then(cached => { if (!cached) - setImmediate(() => { + asap(() => { const lookup = lookupModules(byStore(), { uninitialized: true, }) diff --git a/lib/utils/src/proxy.ts b/lib/utils/src/proxy.ts index 8a6c96d..41bccd3 100644 --- a/lib/utils/src/proxy.ts +++ b/lib/utils/src/proxy.ts @@ -3,6 +3,7 @@ * This is especially useful for blacklisting exports that cannot be patched. */ +import { asap } from './callback' import { getCurrentStack } from './error' import { pTargets } from './patches/proxy' @@ -141,13 +142,7 @@ export function proxify(signal: () => T, options?: ProxifyOptions): T { // Prevent race conditions where proxified values with a self modifying signal gets called, // modifying the original value to a non-proxified value, causing subsequent destructure() calls to fail - ( - // biome-ignore format: Don't format this - // @ts-expect-error: Internal function, not available in all environments - HermesInternal.enqueueJob ?? - globalThis.setImmediate ?? - ((x: () => void) => x()) - )(() => { + asap(() => { if (unproxifyFromHint(hint) == null) DEBUG_warnNullishProxifiedValue() })