Fix Ignore Activities button on platforms different than Windows (#528)

Co-authored-by: Ven <vendicated@riseup.net>
This commit is contained in:
Nuckyz 2023-03-05 20:12:52 -03:00 committed by GitHub
parent bed5e98bb0
commit 95db6c32a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -145,8 +145,11 @@ export default definePlugin({
patches: [{ patches: [{
find: ".Messages.SETTINGS_GAMES_TOGGLE_OVERLAY", find: ".Messages.SETTINGS_GAMES_TOGGLE_OVERLAY",
replacement: { replacement: {
match: /var .=(?<props>.)\.overlay.+?"aria-label":.\..\.Messages\.SETTINGS_GAMES_TOGGLE_OVERLAY.+?}}\)/, match: /!(\i)\|\|(null==\i\)return null;var \i=(\i)\.overlay.+?children:)(\[.{0,70}overlayStatusText.+?\])(?=}\)}\(\))/,
replace: "$&,$self.renderToggleGameActivityButton($<props>)" replace: (_, platformCheck, restWithoutPlatformCheck, props, children) => ""
+ `${restWithoutPlatformCheck}`
+ `(${platformCheck}?${children}:[])`
+ `.concat(Vencord.Plugins.plugins.IgnoreActivities.renderToggleGameActivityButton(${props}))`
} }
}, { }, {
find: ".overlayBadge", find: ".overlayBadge",