Fix IgnoreActivities broken patch (#1337)

This commit is contained in:
Nuckyz 2023-06-25 06:57:18 -03:00 committed by GitHub
parent d7ac418e05
commit afbfb641e8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -45,7 +45,7 @@ function ToggleIconOff() {
className={RegisteredGamesClasses.overlayToggleIconOff} className={RegisteredGamesClasses.overlayToggleIconOff}
height="24" height="24"
width="24" width="24"
viewBox="0 0 32 26" viewBox="0 2.2 32 26"
aria-hidden={true} aria-hidden={true}
role="img" role="img"
> >
@ -77,7 +77,7 @@ function ToggleIconOn({ forceWhite }: { forceWhite?: boolean; }) {
className={RegisteredGamesClasses.overlayToggleIconOn} className={RegisteredGamesClasses.overlayToggleIconOn}
height="24" height="24"
width="24" width="24"
viewBox="0 0 32 26" viewBox="0 2.2 32 26"
> >
<path <path
className={forceWhite ? "" : RegisteredGamesClasses.fill} className={forceWhite ? "" : RegisteredGamesClasses.fill}
@ -119,7 +119,7 @@ function ToggleActivityComponentWithBackground({ activity }: { activity: Ignored
return ( return (
<div <div
className={`${TryItOutClasses.tryItOutBadge} ${BaseShapeRoundClasses.baseShapeRound}`} className={`${TryItOutClasses.tryItOutBadge} ${BaseShapeRoundClasses.baseShapeRound}`}
style={{ padding: "0px 2px" }} style={{ padding: "0px 2px", height: 28 }}
> >
<ToggleActivityComponent activity={activity} forceWhite={true} /> <ToggleActivityComponent activity={activity} forceWhite={true} />
</div> </div>
@ -157,10 +157,16 @@ export default definePlugin({
}, },
{ {
find: ".overlayBadge", find: ".overlayBadge",
replacement: { replacement: [
match: /(?<=\(\)\.badgeContainer.+?(\i)\.name}\):null)/, {
replace: (_, props) => `,$self.renderToggleActivityButton(${props})` match: /(?<=\(\)\.badgeContainer,children:).{0,50}?name:(\i)\.name.+?null/,
} replace: (m, props) => `[${m},$self.renderToggleActivityButton(${props})]`
},
{
match: /(?<=\(\)\.badgeContainer,children:).{0,50}?name:(\i\.application)\.name.+?null/,
replace: (m, props) => `${m},$self.renderToggleActivityButton(${props})`
}
]
}, },
{ {
find: '.displayName="LocalActivityStore"', find: '.displayName="LocalActivityStore"',