From a6971289ad2a0cc1a44f177b9168f73aa47fc527 Mon Sep 17 00:00:00 2001 From: Nuckyz <61953774+Nuckyz@users.noreply.github.com> Date: Wed, 18 Sep 2024 15:05:23 -0300 Subject: [PATCH] now it's right --- src/utils/lazyReact.tsx | 1 + src/webpack/api.tsx | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/utils/lazyReact.tsx b/src/utils/lazyReact.tsx index 8f2715745..404f8a57c 100644 --- a/src/utils/lazyReact.tsx +++ b/src/utils/lazyReact.tsx @@ -11,6 +11,7 @@ export const SYM_LAZY_COMPONENT_INNER = Symbol.for("vencord.lazyComponent.inner" export type LazyComponentType

= React.FunctionComponent

& AnyRecord & { [SYM_LAZY_COMPONENT_INNER]: () => AnyComponentType

| null; }; +export type AnyLazyComponentType

= LazyComponentType

; /** * A lazy component. The factory method is called on first render. diff --git a/src/webpack/api.tsx b/src/webpack/api.tsx index 572d1f4a2..c8083bbe9 100644 --- a/src/webpack/api.tsx +++ b/src/webpack/api.tsx @@ -5,7 +5,7 @@ */ import { makeLazy, proxyLazy } from "@utils/lazy"; -import { LazyComponent, LazyComponentType, SYM_LAZY_COMPONENT_INNER } from "@utils/lazyReact"; +import { AnyLazyComponentType, LazyComponent, SYM_LAZY_COMPONENT_INNER } from "@utils/lazyReact"; import { Logger } from "@utils/Logger"; import { canonicalizeMatch } from "@utils/patches"; import { proxyInner, SYM_PROXY_INNER_GET, SYM_PROXY_INNER_VALUE } from "@utils/proxyInner"; @@ -171,11 +171,11 @@ function printFilter(filter: FilterFn) { return String(filter); } -function wrapWebpackComponent

(err: string | (() => string)): [WrapperComponent: LazyComponentType

, setInnerComponent: (rawComponent: any, parsedComponent: React.ComponentType

) => void] { +function wrapWebpackComponent

(err: string | (() => string)): [WrapperComponent: AnyLazyComponentType

, setInnerComponent: (rawComponent: any, parsedComponent: React.ComponentType

) => void] { let InnerComponent = null as AnyComponentType

| null; let findFailedLogged = false; - const WrapperComponent: LazyComponentType

= function (props) { + const WrapperComponent: AnyLazyComponentType

= function (props) { if (InnerComponent === null && !findFailedLogged) { findFailedLogged = true; logger.error(typeof err === "string" ? err : err());