mirror of
https://github.com/System-End/Vencord.git
synced 2026-04-19 22:05:11 +00:00
Decor: Fix change decoration modal being unable to be opened
This commit is contained in:
parent
e03bb9a6e6
commit
1e284c7cdf
2 changed files with 10 additions and 6 deletions
|
|
@ -109,6 +109,14 @@ 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&&${hasPurchase})`
|
||||
}
|
||||
}
|
||||
],
|
||||
settings,
|
||||
|
||||
|
|
|
|||
|
|
@ -5,8 +5,7 @@
|
|||
*/
|
||||
|
||||
import { AvatarDecoration } from "@plugins/decor";
|
||||
import { findComponentByCode, LazyComponentWebpack } from "@webpack";
|
||||
import { React } from "@webpack/common";
|
||||
import { findComponentByCodeLazy } from "@webpack";
|
||||
import type { ComponentType, HTMLProps, PropsWithChildren } from "react";
|
||||
|
||||
type DecorationGridItemComponent = ComponentType<PropsWithChildren<HTMLProps<HTMLDivElement>> & {
|
||||
|
|
@ -17,10 +16,7 @@ type DecorationGridItemComponent = ComponentType<PropsWithChildren<HTMLProps<HTM
|
|||
export let DecorationGridItem: DecorationGridItemComponent;
|
||||
export const setDecorationGridItem = v => DecorationGridItem = v;
|
||||
|
||||
export const AvatarDecorationModalPreview = LazyComponentWebpack(() => {
|
||||
const component = findComponentByCode(".shopPreviewBanner");
|
||||
return React.memo(component);
|
||||
});
|
||||
export const AvatarDecorationModalPreview = findComponentByCodeLazy("#{intl::PREMIUM_UPSELL_PROFILE_AVATAR_DECO_INLINE_UPSELL_DESCRIPTION}");
|
||||
|
||||
type DecorationGridDecorationComponent = React.ComponentType<HTMLProps<HTMLDivElement> & {
|
||||
avatarDecoration: AvatarDecoration;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue