Files
Not-Nextop/src/renderer/patches/shared.ts
Vendicated e6c1a03c59 Revert "use Vencord's addPatch instead of manually adding patches"
This was pushed prematurely since it depends on a change to Vencord that hasn't been released yet

This reverts commit 68930a1f50.
2025-02-08 03:53:33 +01:00

31 lines
849 B
TypeScript

/*
* Vesktop, a desktop app aiming to give you a snappier Discord Experience
* Copyright (c) 2023 Vendicated and Vencord contributors
* SPDX-License-Identifier: GPL-3.0-or-later
*/
import { Patch } from "@vencord/types/utils/types";
window.VCDP = {};
interface PatchData {
patches: Omit<Patch, "plugin">[];
[key: string]: any;
}
export function addPatch<P extends PatchData>(p: P) {
const { patches, ...globals } = p;
for (const patch of patches as Patch[]) {
if (!Array.isArray(patch.replacement)) patch.replacement = [patch.replacement];
for (const r of patch.replacement) {
if (typeof r.replace === "string") r.replace = r.replace.replaceAll("$self", "VCDP");
}
patch.plugin = "Vesktop";
Vencord.Plugins.patches.push(patch);
}
Object.assign(VCDP, globals);
}