From 5168f326a390b48ffc27d967a96cb99df048ba99 Mon Sep 17 00:00:00 2001 From: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Date: Wed, 15 May 2024 23:07:35 -0300 Subject: [PATCH] keep proper type --- src/utils/lazy.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils/lazy.ts b/src/utils/lazy.ts index 90e2e7e88..92c9c32d6 100644 --- a/src/utils/lazy.ts +++ b/src/utils/lazy.ts @@ -68,7 +68,7 @@ const handler: ProxyHandler = { * @returns Result of factory function */ export function proxyLazy(factory: () => T, attempts = 5, isChild = false): ProxyLazy { - const get = makeLazy(factory, attempts, { isIndirect: true }) as any; + const get = makeLazy(factory, attempts, { isIndirect: true }); let isSameTick = true; if (!isChild) setTimeout(() => isSameTick = false, 0); @@ -76,6 +76,7 @@ export function proxyLazy(factory: () => T, attempts = 5, isChild const proxyDummy = Object.assign(function ProxyDummy() { }, { [proxyLazyGet]() { if (!proxyDummy[proxyLazyCache]) { + // @ts-ignore if (!get.$$vencordLazyFailed()) { proxyDummy[proxyLazyCache] = get(); }