fix(IgnoreActivities): Fix for upcoming change (#399)

This commit is contained in:
Nuckyz 2023-01-11 22:50:31 -03:00 committed by GitHub
parent 19c9a13273
commit b39cbcd934
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -143,10 +143,10 @@ export default definePlugin({
authors: [Devs.Nuckyz],
description: "Ignore certain activities (like games and actual activities) from showing up on your status. You can configure which ones are ignored from the Registered Games and Activities tabs.",
patches: [{
find: ".Messages.SETTINGS_GAMES_OVERLAY_ON",
find: ".Messages.SETTINGS_GAMES_TOGGLE_OVERLAY",
replacement: {
match: /this.renderLastPlayed\(\)]}\),this.renderOverlayToggle\(\)/,
replace: "$&,Vencord.Plugins.plugins.IgnoreActivities.renderToggleGameActivityButton(this.props)"
match: /var .=(?<props>.)\.overlay.+?"aria-label":.\..\.Messages\.SETTINGS_GAMES_TOGGLE_OVERLAY.+?}}\)/,
replace: "$&,Vencord.Plugins.plugins.IgnoreActivities.renderToggleGameActivityButton($<props>)"
}
}, {
find: ".overlayBadge",
@ -189,12 +189,10 @@ export default definePlugin({
}
},
renderToggleGameActivityButton(props: { game: { id?: string; exePath: string; } | null; }) {
if (!props.game) return (null);
renderToggleGameActivityButton(props: { id?: string; exePath: string; }) {
return (
<ErrorBoundary noop>
<ToggleActivityComponent activity={{ id: props.game.id ?? props.game.exePath, type: ActivitiesTypes.Game }} />
<ToggleActivityComponent activity={{ id: props.id ?? props.exePath, type: ActivitiesTypes.Game }} />
</ErrorBoundary>
);
},