Fix PatchHelper and DevCompanion not replacing $self correctly
This commit is contained in:
parent
146a2ac77d
commit
fad2f1e5b4
2 changed files with 2 additions and 2 deletions
|
@ -65,7 +65,7 @@ function ReplacementComponent({ module, match, replacement, setReplacementError
|
||||||
}
|
}
|
||||||
const canonicalMatch = canonicalizeMatch(new RegExp(match));
|
const canonicalMatch = canonicalizeMatch(new RegExp(match));
|
||||||
try {
|
try {
|
||||||
const canonicalReplace = canonicalizeReplace(replacement, "YourPlugin");
|
const canonicalReplace = canonicalizeReplace(replacement, 'Vencord.Plugins.plugins["YourPlugin"]"');
|
||||||
var patched = src.replace(canonicalMatch, canonicalReplace as string);
|
var patched = src.replace(canonicalMatch, canonicalReplace as string);
|
||||||
setReplacementError(void 0);
|
setReplacementError(void 0);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
|
@ -173,7 +173,7 @@ function initWs(isManual = false) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const matcher = canonicalizeMatch(parseNode(match));
|
const matcher = canonicalizeMatch(parseNode(match));
|
||||||
const replacement = canonicalizeReplace(parseNode(replace), "PlaceHolderPluginName");
|
const replacement = canonicalizeReplace(parseNode(replace), 'Vencord.Plugins.plugins["PlaceHolderPluginName"]"');
|
||||||
|
|
||||||
const newSource = src.replace(matcher, replacement as string);
|
const newSource = src.replace(matcher, replacement as string);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue