webpack: fix infinite recursion when using ConsoleShortcuts plugin

This commit is contained in:
Vendicated 2024-03-27 21:27:56 +01:00
parent 31c21594e6
commit 0d22ff0091
No known key found for this signature in database
GPG key ID: D66986BAF75ECF18
4 changed files with 8 additions and 11 deletions

View file

@ -44,7 +44,6 @@ export let PermissionStore: GenericStore;
export let GuildChannelStore: GenericStore;
export let ReadStateStore: GenericStore;
export let PresenceStore: GenericStore;
export let PoggerModeSettingsStore: GenericStore;
export let GuildStore: t.GuildStore;
export let UserStore: Stores.UserStore & t.FluxStore;

View file

@ -110,13 +110,13 @@ export const find = traceFunction("find", function find(filter: FilterFn, { isIn
for (const key in cache) {
const mod = cache[key];
if (!mod?.exports) continue;
if (!mod?.exports || mod.exports === window) continue;
if (filter(mod.exports)) {
return isWaitFor ? [mod.exports, key] : mod.exports;
}
if (mod.exports.default && filter(mod.exports.default)) {
if (mod.exports.default && mod.exports.default !== window && filter(mod.exports.default)) {
const found = mod.exports.default;
return isWaitFor ? [found, key] : found;
}