mirror of
https://github.com/Vendicated/Vencord.git
synced 2025-01-25 00:36:23 +00:00
now it's right
This commit is contained in:
parent
0953ba89ed
commit
a6971289ad
2 changed files with 4 additions and 3 deletions
|
@ -11,6 +11,7 @@ export const SYM_LAZY_COMPONENT_INNER = Symbol.for("vencord.lazyComponent.inner"
|
|||
export type LazyComponentType<P extends AnyRecord = AnyRecord> = React.FunctionComponent<P> & AnyRecord & {
|
||||
[SYM_LAZY_COMPONENT_INNER]: () => AnyComponentType<P> | null;
|
||||
};
|
||||
export type AnyLazyComponentType<P extends AnyRecord> = LazyComponentType<P & AnyRecord>;
|
||||
|
||||
/**
|
||||
* A lazy component. The factory method is called on first render.
|
||||
|
|
|
@ -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<P extends AnyRecord>(err: string | (() => string)): [WrapperComponent: LazyComponentType<P>, setInnerComponent: (rawComponent: any, parsedComponent: React.ComponentType<P>) => void] {
|
||||
function wrapWebpackComponent<P extends AnyRecord>(err: string | (() => string)): [WrapperComponent: AnyLazyComponentType<P>, setInnerComponent: (rawComponent: any, parsedComponent: React.ComponentType<P>) => void] {
|
||||
let InnerComponent = null as AnyComponentType<P> | null;
|
||||
|
||||
let findFailedLogged = false;
|
||||
const WrapperComponent: LazyComponentType<P> = function (props) {
|
||||
const WrapperComponent: AnyLazyComponentType<P> = function (props) {
|
||||
if (InnerComponent === null && !findFailedLogged) {
|
||||
findFailedLogged = true;
|
||||
logger.error(typeof err === "string" ? err : err());
|
||||
|
|
Loading…
Reference in a new issue