diff --git a/src/Vencord.ts b/src/Vencord.ts index 72541148e..a3ae329fc 100644 --- a/src/Vencord.ts +++ b/src/Vencord.ts @@ -39,7 +39,7 @@ import { localStorage } from "./utils/localStorage"; import { relaunch } from "./utils/native"; import { getCloudSettings, putCloudSettings } from "./utils/settingsSync"; import { checkForUpdates, update, UpdateLogger } from "./utils/updater"; -import { onceReady } from "./webpack"; +import { onceDiscordLoaded } from "./webpack"; import { SettingsRouter } from "./webpack/common"; async function syncSettings() { @@ -82,7 +82,7 @@ async function syncSettings() { } async function init() { - await onceReady; + await onceDiscordLoaded; startAllPlugins(StartAt.WebpackReady); syncSettings(); diff --git a/src/plugins/consoleShortcuts/index.ts b/src/plugins/consoleShortcuts/index.ts index 32f8dd4ef..65e469e7e 100644 --- a/src/plugins/consoleShortcuts/index.ts +++ b/src/plugins/consoleShortcuts/index.ts @@ -188,7 +188,7 @@ export default definePlugin({ } // unproxy loaded modules - Webpack.onceReady.then(() => { + Webpack.onceDiscordLoaded.then(() => { setTimeout(() => this.eagerLoad(false), 1000); if (!IS_WEB) { @@ -199,7 +199,7 @@ export default definePlugin({ }, async eagerLoad(forceLoad: boolean) { - await Webpack.onceReady; + await Webpack.onceDiscordLoaded; const shortcuts = makeShortcuts(); diff --git a/src/webpack/common/utils.ts b/src/webpack/common/utils.ts index bdb773e04..d2850f849 100644 --- a/src/webpack/common/utils.ts +++ b/src/webpack/common/utils.ts @@ -17,7 +17,7 @@ */ // eslint-disable-next-line path-alias/no-relative -import { _resolveReady, filters, find, findByCode, findByProps, waitFor } from "../webpack"; +import { _resolveDiscordLoaded, filters, find, findByCode, findByProps, waitFor } from "../webpack"; import type * as t from "./types/utils"; export const FluxDispatcher = find(filters.byProps("dispatch", "subscribe"), (m: t.FluxDispatcher) => { @@ -26,7 +26,7 @@ export const FluxDispatcher = find(filters.byProps("dispatch", const cb = () => { m.unsubscribe("CONNECTION_OPEN", cb); - _resolveReady(); + _resolveDiscordLoaded(); }; m.subscribe("CONNECTION_OPEN", cb); diff --git a/src/webpack/webpack.tsx b/src/webpack/webpack.tsx index 1d7396f37..5c84d48a7 100644 --- a/src/webpack/webpack.tsx +++ b/src/webpack/webpack.tsx @@ -17,12 +17,12 @@ import { GenericStore } from "./common"; const logger = new Logger("Webpack"); -export let _resolveReady: () => void; +export let _resolveDiscordLoaded: () => void; /** * Fired once a gateway connection to Discord has been established. - * This indicates that the core webpack modules have been initialised + * This indicates that the core Webpack modules have been initialized, and we are logged in. */ -export const onceReady = new Promise(r => _resolveReady = r); +export const onceDiscordLoaded = new Promise(r => _resolveDiscordLoaded = r); export let wreq: WebpackInstance; export let cache: WebpackInstance["c"];