From 1843ff4e38f107ec8af9abb8b1787067c49b49c6 Mon Sep 17 00:00:00 2001 From: amsyarasyiq <82711525+amsyarasyiq@users.noreply.github.com> Date: Wed, 26 Jul 2023 19:54:20 +0800 Subject: [PATCH] B"Spotify"I: Real fix --- plugins/BetterSpotifyIntegration/src/index.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/BetterSpotifyIntegration/src/index.tsx b/plugins/BetterSpotifyIntegration/src/index.tsx index 3b1fe85..8f96ff4 100644 --- a/plugins/BetterSpotifyIntegration/src/index.tsx +++ b/plugins/BetterSpotifyIntegration/src/index.tsx @@ -1,4 +1,5 @@ import { findByName } from "@vendetta/metro"; +import { i18n } from "@vendetta/metro/common"; import { before } from "@vendetta/patcher"; import { findInReactTree } from "@vendetta/utils"; @@ -8,8 +9,10 @@ let sectionPatch: () => void; export default { onLoad() { + const getListeningHeader = () => i18n.Messages.USER_ACTIVITY_HEADER_LISTENING?.intlMessage?.format({ name: "Spotify" }); + sectionPatch = before("default", findByName("UserProfileSection", false), ([props]) => { - if (props?.title?.includes?.("Spotify") || props?.activity?.type !== 2) return; + if (props.title !== getListeningHeader()) return; const spotifyElement = findInReactTree(props.children, e => e?.style?.padding === 0); const actionsIndex = spotifyElement?.children?.findIndex?.(e => e?.type?.name === "Actions");