From c8d5333dd65bdea4f88272035afb9618771a139c Mon Sep 17 00:00:00 2001 From: AutumnVN Date: Mon, 24 Jul 2023 22:00:25 +0700 Subject: [PATCH 01/10] revive activities --- src/plugins/activities/icons.tsx | 80 ++++++++++ src/plugins/activities/index.tsx | 252 +++++++++++++++++++++++++++++++ src/plugins/activities/style.css | 71 +++++++++ src/plugins/activities/types.ts | 68 +++++++++ 4 files changed, 471 insertions(+) create mode 100644 src/plugins/activities/icons.tsx create mode 100644 src/plugins/activities/index.tsx create mode 100644 src/plugins/activities/style.css create mode 100644 src/plugins/activities/types.ts diff --git a/src/plugins/activities/icons.tsx b/src/plugins/activities/icons.tsx new file mode 100644 index 0000000000..4c4f7a0b43 --- /dev/null +++ b/src/plugins/activities/icons.tsx @@ -0,0 +1,80 @@ +/* + * Vencord, a modification for Discord's desktop app + * Copyright (c) 2023 Vendicated and contributors + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . +*/ + +import { LazyComponent } from "@utils/react"; +import { findByCode } from "@webpack"; +import { React } from "@webpack/common"; + +interface IconProps { + width: number; + height: number; + color?: string; +} + +export const HeadsetIcon: React.FC = LazyComponent(() => findByCode("M12 2.00305C6.486 2.00305 2 6.48805 2 12.0031V20.0031C2")); + +export const ActivityIcon: React.FC = LazyComponent(() => findByCode("M5.79335761,5 L18.2066424,5 C19.7805584,5 21.0868816,6.21634264")); +export const RichActivityIcon: React.FC = LazyComponent(() => findByCode("M6,7 L2,7 L2,6 L6,6 L6,7 Z M8,5 L2,5 L2,4 L8,4")); + +export const MobileIcon: React.FC = ({ width, height, color }) => { + return + + ; +}; + +export const ControllerIcon: React.FC = ({ width, height, color }) => { + return + + ; +}; + +export const XboxIcon: React.FC = ({ width, height, color }: IconProps) => { + return ( + + + + ); +}; + +export const PlaystationIcon: React.FC = ({ width, height, color }: IconProps) => { + return ( + + + + ); +}; + +export const Caret = ({ disabled, direction }: { disabled: boolean; direction: "left" | "right"; }) => { + return ( + + + + ); +}; diff --git a/src/plugins/activities/index.tsx b/src/plugins/activities/index.tsx new file mode 100644 index 0000000000..9d5ff6ed67 --- /dev/null +++ b/src/plugins/activities/index.tsx @@ -0,0 +1,252 @@ +/* + * Vencord, a modification for Discord's desktop app + * Copyright (c) 2023 Vendicated and contributors + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . +*/ + +import { Devs } from "@utils/constants"; +import { LazyComponent } from "@utils/react"; +import definePlugin, { OptionType } from "@utils/types"; +import { findByCode, findStoreLazy } from "@webpack"; +import { React, Tooltip, useStateFromStores } from "@webpack/common"; +import { Guild, User } from "discord-types/general"; + +import { ActivityIcon, Caret, ControllerIcon, HeadsetIcon, MobileIcon, PlaystationIcon, RichActivityIcon, XboxIcon } from "./icons"; +import { Activity, ActivityProps, ActivityType } from "./types"; + +const PresenceStore = findStoreLazy("PresenceStore"); +const ActivityView = LazyComponent(() => findByCode("onOpenGameProfile:")); + +import "./style.css"; + +import { definePluginSettings } from "@api/Settings"; + +const settings = definePluginSettings({ + moreActivityIcons: { + type: OptionType.BOOLEAN, + restartNeeded: true, + default: true, + description: "e.g. the controller icon for games, headphone icon for spotify.", + }, + showAllActivities: { + type: OptionType.BOOLEAN, + restartNeeded: true, + default: true, + description: "The activities carousel in the user profile." + }, + ignoreBotsIcon: { + type: OptionType.BOOLEAN, + restartNeeded: true, + default: true, + description: "Ignore bots' activities icon." + } +}); + +export default definePlugin({ + name: "Activities", + description: "A combination of the ActivityIcons and ShowAllActivities BD plugins.", + authors: [Devs.Arjix, Devs.AutumnVN], + settings, + + patches: [ + { + find: "().textRuler,", + replacement: { + match: /const \w=function\((\w)\)\{var .*?\.activities.*?.applicationStream.*?children:\[.*?null!=.*?(\w\.some\(.{3}\)\?.*?:null)/, + replace: (m, activities, icon) => m.replace(icon, `$self.ActivitiesComponent(${activities})`) + }, + predicate: () => settings.store.moreActivityIcons + }, + { + find: "().customStatusSection", + replacement: { + match: /\(0,\w\.jsx\)\((\w\.Z),{activity:\w,user:\w,guild:\w,channelId:\w,onClose:\w}\)/, + replace: (m, component) => m.replace(component, "$self.ShowAllActivitiesComponent") + }, + predicate: () => settings.store.showAllActivities + } + ], + + ShowAllActivitiesComponent({ activity, user, guild, channelId, onClose }: + { activity: Activity; user: User, guild: Guild, channelId: string, onClose: () => void; }) { + const [currentActivity, setCurrentActivity] = React.useState( + activity?.type !== ActivityType.CustomStatus ? activity! : null + ); + + const activities = useStateFromStores( + [PresenceStore], () => PresenceStore.getActivities(user.id).filter((activity: Activity) => activity.type !== ActivityType.CustomStatus) + ) ?? []; + + React.useEffect(() => { + if (!activities.length) { + setCurrentActivity(null); + return; + } + + if (!currentActivity || !activities.includes(currentActivity)) + setCurrentActivity(activities[0]); + + }, [activities]); + + if (!activities.length) return null; + + return ( +
+ +
+ {({ onMouseEnter, onMouseLeave }) => { + return { + const index = activities.indexOf(currentActivity!); + if (index - 1 >= 0) + setCurrentActivity(activities[index - 1]); + }} + > + + ; + }} + +
+ {activities.map((activity, index) => ( +
setCurrentActivity(activity)} + className={`dot ${currentActivity === activity ? "selected" : ""}`} + /> + ))} +
+ + {({ onMouseEnter, onMouseLeave }) => { + return { + const index = activities.indexOf(currentActivity!); + if (index + 1 < activities.length) + setCurrentActivity(activities[index + 1]); + }} + > + = activities.length - 1} + direction="right" + /> + ; + }} +
+
+ ); + }, + + ActivitiesComponent(props: ActivityProps) { + const botActivityKeys = ["created_at", "id", "name", "type", "url"]; + const isBot = props.activities.length === 1 && Object.keys(props.activities[0]).every((value, i) => value === botActivityKeys[i]); + if (!props.activities.length || (isBot && settings.store.ignoreBotsIcon)) return null; + const gameActivities: Activity[] = []; + + const icons = props.activities.map(activity => { + switch (activity.type) { + case ActivityType.Competing: + case ActivityType.Playing: { + if (!activity.platform) { + gameActivities.push(activity); + return; + } + + const isXbox = activity.platform === "xbox"; + const isPlaystation = /ps\d/.test(activity.platform ?? ""); + const isSamsung = activity.platform === "samsung"; + + let icon: React.ReactNode = ; + + if (isXbox) icon = ; + if (isPlaystation) icon = ; + if (isSamsung) icon = ; + + return ( + { + ({ onMouseEnter, onMouseLeave }) => { + return {icon}; + } + } + ); + } + + case ActivityType.Listening: { + let tooltipText = ""; + if (activity.details && activity.state) { + const artists = (activity.state.split(";") ?? []).map(a => a.trim()); + let songTitle = activity.details; + + for (const artist of artists) { + songTitle = songTitle.replace(`(feat. ${artist})`, ""); + } + + tooltipText = `${songTitle.trim()} - ${artists.join(", ")}`; + } else { + tooltipText = activity.name ?? ""; + } + + return + {({ onMouseEnter, onMouseLeave }) => { + return + + ; + }} + ; + } + default: return; + } + }).filter(Boolean); + + const richPresenceActivities = gameActivities.filter(activity => (activity.assets || activity.details)); + + const gameIcons: React.ReactNode[] = []; + for (const gameActivity of gameActivities) { + const activityIcon = richPresenceActivities.includes(gameActivity) ? + + : ; + + gameActivity && gameIcons.push( + {({ onMouseEnter, onMouseLeave }) => { + return {activityIcon}; + }} + ); + } + + return ( + + {gameIcons.concat(icons)} + + ); + }, +}); diff --git a/src/plugins/activities/style.css b/src/plugins/activities/style.css new file mode 100644 index 0000000000..7e3b7141e2 --- /dev/null +++ b/src/plugins/activities/style.css @@ -0,0 +1,71 @@ +.vc-activities-caret-left, +.vc-activities-caret-right { + color: #ddd; +} + +.vc-activities-caret-left { + transform: rotate(90deg); +} + +.vc-activities-caret-right { + transform: rotate(-90deg); +} + +.vc-activities-controls { + margin-bottom: 10px; + display: flex; + align-items: center; + justify-content: space-between; + padding: 5px; + background: var(--background-secondary-alt); + border-radius: 3px; + flex: 1 0; + margin-top: 10px; +} + +.vc-activities-controls [class^="vc-activities-caret-"] { + display: inline-flex; + align-items: center; + justify-content: center; + cursor: pointer; + border-radius: 3px; + background-color: #ffffff4d; +} + +.vc-activities-controls [class^="vc-activities-caret-"].disabled { + cursor: not-allowed; + opacity: 0.3; +} + +.vc-activities-controls [class^="vc-activities-caret-"]:hover:not(.disabled) { + background: var(--background-modifier-accent); +} + +.vc-activities-controls .carousell { + display: flex; + align-items: center; +} + +.vc-activities-controls .carousell .dot { + margin: 0 4px; + width: 10px; + cursor: pointer; + height: 10px; + border-radius: 100px; + background: var(--interactive-muted); + transition: background 0.3s; + opacity: 0.6; +} + +.vc-activities-controls .carousell .dot:hover:not(.selected) { + opacity: 1; +} + +.vc-activities-controls .carousell .dot.selected { + opacity: 1; + background: var(--dot-color, var(--brand-experiment)); +} + +.vc-activities-controls-tooltip { + --background-floating: var(--background-secondary); +} diff --git a/src/plugins/activities/types.ts b/src/plugins/activities/types.ts new file mode 100644 index 0000000000..d997595f1a --- /dev/null +++ b/src/plugins/activities/types.ts @@ -0,0 +1,68 @@ +/* + * Vencord, a modification for Discord's desktop app + * Copyright (c) 2023 Vendicated and contributors + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . +*/ + +export interface ActivityProps { + className: string; + textClassName: string; + emojiClassName: string; + activities: Activity[]; + applicationStream: null; + animate: boolean; + hideEmoji: boolean; + hideTooltip: boolean; +} + +export interface Activity { + created_at: string; + id: string; + name: string; + state?: string; + type: ActivityType; + assets?: Assets; + flags?: number; + platform?: string; + timestamps?: Timestamps; + details?: string; + party?: Party; + session_id?: string; + sync_id?: string; +} + +export enum ActivityType { + Playing = 0, + Streaming = 1, + Listening = 2, + Watching = 3, + CustomStatus = 4, + Competing = 5, +} + +export interface Assets { + small_image?: string; + large_image?: string; + large_text?: string; +} + +export interface Party { + id: string; +} + +export interface Timestamps { + start: string; + end?: string; +} From de12f0c302d1b7704ce5ed3a957329c2beded17a Mon Sep 17 00:00:00 2001 From: AutumnVN Date: Thu, 24 Aug 2023 10:42:02 +0700 Subject: [PATCH 02/10] header --- src/plugins/activities/icons.tsx | 18 +++--------------- src/plugins/activities/index.tsx | 18 +++--------------- src/plugins/activities/types.ts | 18 +++--------------- 3 files changed, 9 insertions(+), 45 deletions(-) diff --git a/src/plugins/activities/icons.tsx b/src/plugins/activities/icons.tsx index 4c4f7a0b43..cd3bcb34fc 100644 --- a/src/plugins/activities/icons.tsx +++ b/src/plugins/activities/icons.tsx @@ -1,20 +1,8 @@ /* - * Vencord, a modification for Discord's desktop app + * Vencord, a Discord client mod * Copyright (c) 2023 Vendicated and contributors - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . -*/ + * SPDX-License-Identifier: GPL-3.0-or-later + */ import { LazyComponent } from "@utils/react"; import { findByCode } from "@webpack"; diff --git a/src/plugins/activities/index.tsx b/src/plugins/activities/index.tsx index 9d5ff6ed67..9df6cdae16 100644 --- a/src/plugins/activities/index.tsx +++ b/src/plugins/activities/index.tsx @@ -1,20 +1,8 @@ /* - * Vencord, a modification for Discord's desktop app + * Vencord, a Discord client mod * Copyright (c) 2023 Vendicated and contributors - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . -*/ + * SPDX-License-Identifier: GPL-3.0-or-later + */ import { Devs } from "@utils/constants"; import { LazyComponent } from "@utils/react"; diff --git a/src/plugins/activities/types.ts b/src/plugins/activities/types.ts index d997595f1a..ea62b27da1 100644 --- a/src/plugins/activities/types.ts +++ b/src/plugins/activities/types.ts @@ -1,20 +1,8 @@ /* - * Vencord, a modification for Discord's desktop app + * Vencord, a Discord client mod * Copyright (c) 2023 Vendicated and contributors - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . -*/ + * SPDX-License-Identifier: GPL-3.0-or-later + */ export interface ActivityProps { className: string; From e2190b33d549dd6706fbd064c30e81db4ac4ff57 Mon Sep 17 00:00:00 2001 From: AutumnVN Date: Tue, 26 Sep 2023 10:53:18 +0700 Subject: [PATCH 03/10] fix some icon use findByCode explod --- src/plugins/activities/icons.tsx | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/src/plugins/activities/icons.tsx b/src/plugins/activities/icons.tsx index cd3bcb34fc..75e8694032 100644 --- a/src/plugins/activities/icons.tsx +++ b/src/plugins/activities/icons.tsx @@ -13,11 +13,29 @@ interface IconProps { height: number; color?: string; } +export const RichActivityIcon: React.FC = LazyComponent(() => findByCode("M6,7 L2,7 L2,6 L6,6 L6,7 Z M8,5 L2,5 L2,4 L8,4")); -export const HeadsetIcon: React.FC = LazyComponent(() => findByCode("M12 2.00305C6.486 2.00305 2 6.48805 2 12.0031V20.0031C2")); +export const HeadsetIcon: React.FC = ({ width, height, color }: IconProps) => { + return ( + + + + ); +}; -export const ActivityIcon: React.FC = LazyComponent(() => findByCode("M5.79335761,5 L18.2066424,5 C19.7805584,5 21.0868816,6.21634264")); -export const RichActivityIcon: React.FC = LazyComponent(() => findByCode("M6,7 L2,7 L2,6 L6,6 L6,7 Z M8,5 L2,5 L2,4 L8,4")); +export const ActivityIcon: React.FC = ({ width, height, color }: IconProps) => { + return ( + + + + ); +}; export const MobileIcon: React.FC = ({ width, height, color }) => { return From 2e8f9994aa202a8174fd38fd3061f05e12469221 Mon Sep 17 00:00:00 2001 From: AutumnVN Date: Tue, 26 Sep 2023 15:00:01 +0700 Subject: [PATCH 04/10] add tags --- src/plugins/activities/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/activities/index.tsx b/src/plugins/activities/index.tsx index 9df6cdae16..81c952d051 100644 --- a/src/plugins/activities/index.tsx +++ b/src/plugins/activities/index.tsx @@ -46,6 +46,7 @@ export default definePlugin({ name: "Activities", description: "A combination of the ActivityIcons and ShowAllActivities BD plugins.", authors: [Devs.Arjix, Devs.AutumnVN], + tags: ["ActivityIcons", "ShowAllActivities"], settings, patches: [ From 7298fc40668e452181891b125f72e21236a3cb38 Mon Sep 17 00:00:00 2001 From: AutumnVN Date: Wed, 11 Oct 2023 09:24:47 +0700 Subject: [PATCH 05/10] fix ignore bot --- src/plugins/activities/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/activities/index.tsx b/src/plugins/activities/index.tsx index 81c952d051..936aa58a50 100644 --- a/src/plugins/activities/index.tsx +++ b/src/plugins/activities/index.tsx @@ -157,7 +157,7 @@ export default definePlugin({ }, ActivitiesComponent(props: ActivityProps) { - const botActivityKeys = ["created_at", "id", "name", "type", "url"]; + const botActivityKeys = ["type", "name", "id", "created_at"]; const isBot = props.activities.length === 1 && Object.keys(props.activities[0]).every((value, i) => value === botActivityKeys[i]); if (!props.activities.length || (isBot && settings.store.ignoreBotsIcon)) return null; const gameActivities: Activity[] = []; From d7a88e343033c7ee75420fe3235eccc83e99ed24 Mon Sep 17 00:00:00 2001 From: AutumnVN Date: Sun, 15 Oct 2023 12:28:54 +0700 Subject: [PATCH 06/10] remove margin bottom --- src/plugins/activities/style.css | 1 - 1 file changed, 1 deletion(-) diff --git a/src/plugins/activities/style.css b/src/plugins/activities/style.css index 7e3b7141e2..430a7a39d4 100644 --- a/src/plugins/activities/style.css +++ b/src/plugins/activities/style.css @@ -12,7 +12,6 @@ } .vc-activities-controls { - margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; From 3bd87c5dc2eadb677dbf0e366eaba841c47ae272 Mon Sep 17 00:00:00 2001 From: AutumnVN Date: Wed, 25 Oct 2023 17:53:11 +0700 Subject: [PATCH 07/10] fix --- src/plugins/activities/index.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugins/activities/index.tsx b/src/plugins/activities/index.tsx index 936aa58a50..7cbdba766f 100644 --- a/src/plugins/activities/index.tsx +++ b/src/plugins/activities/index.tsx @@ -51,17 +51,17 @@ export default definePlugin({ patches: [ { - find: "().textRuler,", + find: "textRuler,", replacement: { - match: /const \w=function\((\w)\)\{var .*?\.activities.*?.applicationStream.*?children:\[.*?null!=.*?(\w\.some\(.{3}\)\?.*?:null)/, + match: /var \i=(\i)=>\{let{activities:\i,.*?children:\[.*?null!=\i&&(\i\.some\(\i\.\i\)\?.*?:null)/, replace: (m, activities, icon) => m.replace(icon, `$self.ActivitiesComponent(${activities})`) }, predicate: () => settings.store.moreActivityIcons }, { - find: "().customStatusSection", + find: "customStatusSection,", replacement: { - match: /\(0,\w\.jsx\)\((\w\.Z),{activity:\w,user:\w,guild:\w,channelId:\w,onClose:\w}\)/, + match: /\(0,\i\.jsx\)\((\i\.\i),{activity:\i,user:\i,guild:\i,channelId:\i,onClose:\i}\)/, replace: (m, component) => m.replace(component, "$self.ShowAllActivitiesComponent") }, predicate: () => settings.store.showAllActivities From c6294ba40d8a1f155fc467561bfc8d543ce67d24 Mon Sep 17 00:00:00 2001 From: AutumnVN Date: Wed, 7 Feb 2024 08:42:11 +0700 Subject: [PATCH 08/10] fix --- src/plugins/activities/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/activities/index.tsx b/src/plugins/activities/index.tsx index 7cbdba766f..97fb3ccc6e 100644 --- a/src/plugins/activities/index.tsx +++ b/src/plugins/activities/index.tsx @@ -53,7 +53,7 @@ export default definePlugin({ { find: "textRuler,", replacement: { - match: /var \i=(\i)=>\{let{activities:\i,.*?children:\[.*?null!=\i&&(\i\.some\(\i\.\i\)\?.*?:null)/, + match: /var \i=(\i)=>\{.*?let{activities:\i,.*?children:\[.*?null!=\i&&(\i\.some\(\i\.\i\)\?.*?:null)/, replace: (m, activities, icon) => m.replace(icon, `$self.ActivitiesComponent(${activities})`) }, predicate: () => settings.store.moreActivityIcons From 0f5d8ed51af5938cf05abedb731aa841067c0410 Mon Sep 17 00:00:00 2001 From: AutumnVN Date: Thu, 29 Feb 2024 18:45:30 -0800 Subject: [PATCH 09/10] fix patch --- src/plugins/activities/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/activities/index.tsx b/src/plugins/activities/index.tsx index 97fb3ccc6e..43fb26f94a 100644 --- a/src/plugins/activities/index.tsx +++ b/src/plugins/activities/index.tsx @@ -61,7 +61,7 @@ export default definePlugin({ { find: "customStatusSection,", replacement: { - match: /\(0,\i\.jsx\)\((\i\.\i),{activity:\i,user:\i,guild:\i,channelId:\i,onClose:\i}\)/, + match: /\(0,\i\.jsx\)\((\i\.\i),{activity:\i,user:\i,guild:\i,channelId:\i,onClose:\i,/, replace: (m, component) => m.replace(component, "$self.ShowAllActivitiesComponent") }, predicate: () => settings.store.showAllActivities From 4a68953838fa8f62b853420b7269bd8cc45d51cc Mon Sep 17 00:00:00 2001 From: AutumnVN Date: Thu, 28 Mar 2024 10:27:06 +0700 Subject: [PATCH 10/10] fix again --- src/plugins/activities/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/activities/index.tsx b/src/plugins/activities/index.tsx index 43fb26f94a..0fb8d0fc8d 100644 --- a/src/plugins/activities/index.tsx +++ b/src/plugins/activities/index.tsx @@ -53,7 +53,7 @@ export default definePlugin({ { find: "textRuler,", replacement: { - match: /var \i=(\i)=>\{.*?let{activities:\i,.*?children:\[.*?null!=\i&&(\i\.some\(\i\.\i\)\?.*?:null)/, + match: /(\i)=>\{.*?let{activities:\i,.*?children:\[.*?null!=\i&&(\i\.some\(\i=>\(0,\i\.\i\)\(\i,\i\)\)\?.*?:null)/, replace: (m, activities, icon) => m.replace(icon, `$self.ActivitiesComponent(${activities})`) }, predicate: () => settings.store.moreActivityIcons