|
|
|
@ -20,7 +20,7 @@ import { proxyLazy } from "@utils/lazy";
|
|
|
|
|
import type * as Stores from "discord-types/stores";
|
|
|
|
|
|
|
|
|
|
// eslint-disable-next-line path-alias/no-relative
|
|
|
|
|
import { filters, findByCode, findByProps, findByPropsLazy, mapMangledModuleLazy } from "../webpack";
|
|
|
|
|
import { filters, findByProps, findByPropsLazy, mapMangledModuleLazy } from "../webpack";
|
|
|
|
|
import { waitForStore } from "./internal";
|
|
|
|
|
import * as t from "./types/stores";
|
|
|
|
|
|
|
|
|
@ -84,14 +84,7 @@ export const useStateFromStores: <T>(
|
|
|
|
|
idk?: any,
|
|
|
|
|
isEqual?: (old: T, newer: T) => boolean
|
|
|
|
|
) => T
|
|
|
|
|
// FIXME: hack to support old stable and new canary
|
|
|
|
|
= proxyLazy(() => {
|
|
|
|
|
try {
|
|
|
|
|
return findByProps("useStateFromStores").useStateFromStores;
|
|
|
|
|
} catch {
|
|
|
|
|
return findByCode('("useStateFromStores")');
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
= proxyLazy(() => findByProps("useStateFromStores").useStateFromStores);
|
|
|
|
|
|
|
|
|
|
waitForStore("DraftStore", s => DraftStore = s);
|
|
|
|
|
waitForStore("UserStore", s => UserStore = s);
|
|
|
|
|