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

@ -1,6 +1,6 @@
> [!WARNING] > [!WARNING]
> These instructions are only for advanced users. If you're not a Developer, you should use our [graphical installer](https://github.com/Vendicated/VencordInstaller#usage) instead. > These instructions are only for advanced users. If you're not a Developer, you should use our [graphical installer](https://github.com/Vendicated/VencordInstaller#usage) instead.
> No support will be provided for installing in this fashion. If you cannot figure it out, you should just stick to a regular install. > No support will be provided for installing in this fashion. If you cannot figure it out, you should just stick to a regular install.
# Installation Guide # Installation Guide
@ -95,5 +95,3 @@ Simply run:
```shell ```shell
pnpm uninject pnpm uninject
``` ```
If you need more help, ask in the support channel in our [Discord Server](https://discord.gg/D9uwnFnqmd).

View file

@ -13,10 +13,10 @@ export default definePlugin({
authors: [Devs.Ven], authors: [Devs.Ven],
patches: [{ patches: [{
find: '"gift")),(null', find: '"sticker")',
replacement: { replacement: {
match: /!\i\.isMobile&&(?=\(\i\.isDM.+?&&(\i)\.push\(.{0,50}"gift")/, match: /!\i\.isMobile(?=.+?(\i)\.push\(.{0,50}"gift")/,
replace: "$&(Vencord.Api.ChatButtons._injectButtons($1,arguments[0]),!0)&&" replace: "$& &&(Vencord.Api.ChatButtons._injectButtons($1,arguments[0]),true)"
} }
}] }]
}); });

View file

@ -44,7 +44,6 @@ export let PermissionStore: GenericStore;
export let GuildChannelStore: GenericStore; export let GuildChannelStore: GenericStore;
export let ReadStateStore: GenericStore; export let ReadStateStore: GenericStore;
export let PresenceStore: GenericStore; export let PresenceStore: GenericStore;
export let PoggerModeSettingsStore: GenericStore;
export let GuildStore: t.GuildStore; export let GuildStore: t.GuildStore;
export let UserStore: Stores.UserStore & t.FluxStore; 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) { for (const key in cache) {
const mod = cache[key]; const mod = cache[key];
if (!mod?.exports) continue; if (!mod?.exports || mod.exports === window) continue;
if (filter(mod.exports)) { if (filter(mod.exports)) {
return isWaitFor ? [mod.exports, key] : 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; const found = mod.exports.default;
return isWaitFor ? [found, key] : found; return isWaitFor ? [found, key] : found;
} }