aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/ignoreActivities.tsx
diff options
context:
space:
mode:
authorNuckyz <61953774+Nuckyz@users.noreply.github.com>2023-01-07 22:15:22 -0300
committerGitHub <noreply@github.com>2023-01-08 02:15:22 +0100
commitf0240ec3457aff627b56d75876a8ed9fc8a98a5d (patch)
treed5c522ac30100e5f83ffa5bd03220e409f13f8dd /src/plugins/ignoreActivities.tsx
parent15aa2299c3220aa5964981b0958338b6fad1d5b9 (diff)
downloadVencord-f0240ec3457aff627b56d75876a8ed9fc8a98a5d.tar.gz
Vencord-f0240ec3457aff627b56d75876a8ed9fc8a98a5d.tar.bz2
Vencord-f0240ec3457aff627b56d75876a8ed9fc8a98a5d.zip
chore(plugins): Fix IgnoreActivities & clean up other plugins (#384)
Diffstat (limited to 'src/plugins/ignoreActivities.tsx')
-rw-r--r--src/plugins/ignoreActivities.tsx16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/plugins/ignoreActivities.tsx b/src/plugins/ignoreActivities.tsx
index a85e501..cfaaafd 100644
--- a/src/plugins/ignoreActivities.tsx
+++ b/src/plugins/ignoreActivities.tsx
@@ -35,7 +35,7 @@ interface IgnoredActivity {
}
const RegisteredGamesClasses = findByPropsLazy("overlayToggleIconOff", "overlayToggleIconOn");
-const PreviewBadgeClasses = findByPropsLazy("previewBadge", "previewBadgeIcon");
+const TryItOutClasses = findByPropsLazy("tryItOutBadge", "tryItOutBadgeIcon");
const BaseShapeRoundClasses = findByPropsLazy("baseShapeRound", "baseShapeRoundLeft", "baseShapeRoundRight");
const RunningGameStore = findByPropsLazy("getRunningGames", "getGamesSeen");
@@ -116,7 +116,7 @@ function ToggleActivityComponent({ activity }: { activity: IgnoredActivity; }) {
function ToggleActivityComponentWithBackground({ activity }: { activity: IgnoredActivity; }) {
return (
<div
- className={`${PreviewBadgeClasses.previewBadge} ${BaseShapeRoundClasses.baseShapeRound}`}
+ className={`${TryItOutClasses.tryItOutBadge} ${BaseShapeRoundClasses.baseShapeRound}`}
style={{ padding: "0 2px" }}
>
<ToggleActivityComponent activity={activity} />
@@ -145,11 +145,11 @@ export default definePlugin({
patches: [{
find: ".Messages.SETTINGS_GAMES_OVERLAY_ON",
replacement: {
- match: /(this.renderLastPlayed\(\)]}\),this.renderOverlayToggle\(\))/,
- replace: "$1,Vencord.Plugins.plugins.IgnoreActivities.renderToggleGameActivityButton(this.props)"
+ match: /this.renderLastPlayed\(\)]}\),this.renderOverlayToggle\(\)/,
+ replace: "$&,Vencord.Plugins.plugins.IgnoreActivities.renderToggleGameActivityButton(this.props)"
}
}, {
- find: ".Messages.NEW,name",
+ find: ".overlayBadge",
replacement: {
match: /.badgeContainer.+?.\?\(0,.\.jsx\)\(.{1,2},{name:(?<props>.)\.name}\):null/,
replace: "$&,Vencord.Plugins.plugins.IgnoreActivities.renderToggleActivityButton($<props>)"
@@ -157,8 +157,8 @@ export default definePlugin({
}, {
find: '.displayName="LocalActivityStore"',
replacement: {
- match: /((.)\.push\(.\({type:.\..{1,3}\.LISTENING.+?;)/,
- replace: "$1$2=$2.filter(Vencord.Plugins.plugins.IgnoreActivities.isActivityEnabled);"
+ match: /(?<activities>.)\.push\(.\({type:.\..{1,3}\.LISTENING.+?\)\)/,
+ replace: "$&;$<activities>=$<activities>.filter(Vencord.Plugins.plugins.IgnoreActivities.isActivityIgnored);"
}
}],
@@ -207,7 +207,7 @@ export default definePlugin({
);
},
- isActivityEnabled(props: { type: number; application_id?: string; name?: string; }) {
+ isActivityIgnored(props: { type: number; application_id?: string; name?: string; }) {
if (props.type === 0) {
if (props.application_id !== undefined) return !ignoredActivitiesCache.has(props.application_id);
else {