fix some more patches

This commit is contained in:
thororen1234 2026-04-30 21:10:10 -04:00
parent caab1fd59a
commit c1022cc392
No known key found for this signature in database
2 changed files with 6 additions and 26 deletions

View file

@ -111,16 +111,10 @@ export default definePlugin({
// Patch avatar decoration preview to display Decor avatar decorations as if they are purchased
{
find: "#{intl::PREMIUM_UPSELL_PROFILE_AVATAR_DECO_INLINE_UPSELL_DESCRIPTION}",
replacement: [
{
match: /(#{intl::PREMIUM_UPSELL_PROFILE_AVATAR_DECO_INLINE_UPSELL_DESCRIPTION}.+?return null!=(\i)&&\()(null==\i)/,
replace: (_, rest, avatarDecoration, hasPurchase) => `${rest}(${avatarDecoration}.skuId!==$self.SKU_ID&&${avatarDecoration}.skuId!==$self.RAW_SKU_ID&&${hasPurchase})`
},
{
match: /(?<==)\i=>{let{user:\i,guildId:\i,avatarDecoration:/,
replace: "$self.AvatarDecorationModalPreview=$&"
}
]
replacement: {
match: /(?<==)\i=>{let{user:\i,guildId:\i,avatarDecoration:/,
replace: "$self.AvatarDecorationModalPreview=$&"
}
}
],
settings,

View file

@ -15,13 +15,11 @@ import { Devs, IS_MAC } from "@utils/constants";
import { Margins } from "@utils/margins";
import definePlugin, { OptionType } from "@utils/types";
import { findByPropsLazy } from "@webpack";
import { React } from "@webpack/common";
import { ExperimentStore, React } from "@webpack/common";
import hideBugReport from "./hideBugReport.css?managed";
const KbdStyles = findByPropsLazy("key", "combo");
let BugReporterExperiment: any;
const modKey = IS_MAC ? "cmd" : "ctrl";
const altKey = IS_MAC ? "opt" : "alt";
@ -147,19 +145,7 @@ export default definePlugin({
}
]
},
{
find: "2026-01-bug-reporter",
replacement: {
match: /(?<==)(?=\(0,\i\(.+?\)\.\i\)\({name:"2026-01-bug-reporter")/,
replace: "$self.BugReporterExperiment="
}
}
],
set BugReporterExperiment(value: any) {
BugReporterExperiment = value;
},
matchExperiment(url: string, label: string): boolean {
const items = url.split("/");
const labelCleaned = label.replace(/[^a-zA-Z0-9]+/g, "").toLowerCase();
@ -167,7 +153,7 @@ export default definePlugin({
return !!labelCleaned && urlEndCleaned !== undefined && labelCleaned === urlEndCleaned;
},
start: () => !BugReporterExperiment.getConfig().hasBugReporterAccess && enableStyle(hideBugReport),
start: () => ExperimentStore.getUserExperimentBucket("2026-01-bug-reporter") > 0 && enableStyle(hideBugReport),
stop: () => disableStyle(hideBugReport),
settingsAboutComponent: () => {