From 98d3945d66b583a528f0a9395c481f425d3a86de Mon Sep 17 00:00:00 2001 From: RobinRMC Date: Wed, 29 Jan 2025 01:06:24 +0100 Subject: [PATCH] Revert some changes --- src/plusplugins/KeywordNotify/index.tsx | 23 ++++++++++--------- .../components/BookmarkContainer.tsx | 5 ++-- .../channelTabs/components/ChannelTab.tsx | 6 ++--- .../components/ChannelTabsContainer.tsx | 5 ++-- src/plusplugins/channelTabs/util/constants.ts | 6 ++--- 5 files changed, 24 insertions(+), 21 deletions(-) diff --git a/src/plusplugins/KeywordNotify/index.tsx b/src/plusplugins/KeywordNotify/index.tsx index 939ed97fe72..c5eb3a8a9b7 100644 --- a/src/plusplugins/KeywordNotify/index.tsx +++ b/src/plusplugins/KeywordNotify/index.tsx @@ -1,6 +1,6 @@ /* * Vencord, a Discord client mod - * Copyright (c) 2024 Vendicated, camila314, and contributors + * Copyright (c) 2025 Vendicated, camila314, and contributors * SPDX-License-Identifier: GPL-3.0-or-later */ @@ -328,16 +328,17 @@ export default definePlugin({ }, { find: ".guildFilter:null", - replacement: [ - { - match: /function (\i)\(\i\){let{message:\i,gotoMessage/, - replace: "$self.renderMsg = $1; $&" - }, - { - match: /onClick:\(\)=>(\i\.\i\.deleteRecentMention\((\i)\.id\))/, - replace: "onClick: () => $2._keyword ? $self.deleteKeyword($2.id) : $1" - } - ] + replacement: { + match: /function (\i)\(\i\){let{message:\i,gotoMessage/, + replace: "$self.renderMsg = $1; $&" + } + }, + { + find: ".guildFilter:null", + replacement: { + match: /onClick:\(\)=>(\i\.\i\.deleteRecentMention\((\i)\.id\))/, + replace: "onClick: () => $2._keyword ? $self.deleteKeyword($2.id) : $1" + } } ], diff --git a/src/plusplugins/channelTabs/components/BookmarkContainer.tsx b/src/plusplugins/channelTabs/components/BookmarkContainer.tsx index 15d3ef906d4..0d3cd2c9d8e 100644 --- a/src/plusplugins/channelTabs/components/BookmarkContainer.tsx +++ b/src/plusplugins/channelTabs/components/BookmarkContainer.tsx @@ -8,7 +8,8 @@ import { classNameFactory } from "@api/Styles"; import { getIntlMessage } from "@utils/discord"; import { classes } from "@utils/misc"; import { closeModal, openModal } from "@utils/modal"; -import { Avatar, ChannelStore, ContextMenuApi, FluxDispatcher, GuildStore, Icons, Menu, ReadStateStore, ReadStateUtils, Text, Tooltip, useDrag, useDrop, useEffect, useRef, UserStore } from "@webpack/common"; +import { findByPropsLazy } from "@webpack"; +import { Avatar, ChannelStore, ContextMenuApi, FluxDispatcher, GuildStore, Menu, ReadStateStore, ReadStateUtils, Text, Tooltip, useDrag, useDrop, useEffect, useRef, UserStore } from "@webpack/common"; import { BasicChannelTabsProps, Bookmark, BookmarkFolder, BookmarkProps, CircleQuestionIcon, isBookmarkFolder, settings, switchChannel, useBookmarks } from "../util"; import { NotificationDot } from "./ChannelTab"; @@ -16,7 +17,7 @@ import { BookmarkContextMenu, EditModal } from "./ContextMenus"; const cl = classNameFactory("vc-channeltabs-"); -const { StarIcon } = Icons; +const { StarIcon } = findByPropsLazy("StarIcon"); function FolderIcon({ fill }: { fill: string; }) { return ( diff --git a/src/plusplugins/channelTabs/components/ChannelTab.tsx b/src/plusplugins/channelTabs/components/ChannelTab.tsx index 9da2ea151af..3bdd20ce183 100644 --- a/src/plusplugins/channelTabs/components/ChannelTab.tsx +++ b/src/plusplugins/channelTabs/components/ChannelTab.tsx @@ -1,6 +1,6 @@ /* * Vencord, a Discord client mod - * Copyright (c) 2025 Vendicated and contributors + * Copyright (c) 2024 Vendicated and contributors * SPDX-License-Identifier: GPL-3.0-or-later */ @@ -8,7 +8,7 @@ import { classNameFactory } from "@api/Styles"; import { getIntlMessage, getUniqueUsername } from "@utils/discord"; import { classes } from "@utils/misc"; import { findByPropsLazy, findComponentByCodeLazy } from "@webpack"; -import { Avatar, ChannelStore, ContextMenuApi, Dots, GuildStore, Icons, PresenceStore, ReadStateStore, Text, TypingStore, useDrag, useDrop, useRef, UserStore, useStateFromStores } from "@webpack/common"; +import { Avatar, ChannelStore, ContextMenuApi, Dots, GuildStore, PresenceStore, ReadStateStore, Text, TypingStore, useDrag, useDrop, useRef, UserStore, useStateFromStores } from "@webpack/common"; import { Channel, Guild, User } from "discord-types/general"; import { ChannelTabsProps, CircleQuestionIcon, closeTab, isTabSelected, moveDraggedTabs, moveToTab, openedTabs, settings } from "../util"; @@ -17,7 +17,7 @@ import { TabContextMenu } from "./ContextMenus"; const { getBadgeWidthForValue } = findByPropsLazy("getBadgeWidthForValue"); const dotStyles = findByPropsLazy("numberBadge", "textBadge"); -const { FriendsIcon } = Icons; +const { FriendsIcon } = findByPropsLazy("FriendsIcon"); const ChannelTypeIcon = findComponentByCodeLazy(".iconContainerWithGuildIcon,"); const cl = classNameFactory("vc-channeltabs-"); diff --git a/src/plusplugins/channelTabs/components/ChannelTabsContainer.tsx b/src/plusplugins/channelTabs/components/ChannelTabsContainer.tsx index 58046cb4cf3..f5e110855e6 100644 --- a/src/plusplugins/channelTabs/components/ChannelTabsContainer.tsx +++ b/src/plusplugins/channelTabs/components/ChannelTabsContainer.tsx @@ -6,7 +6,8 @@ import { classNameFactory } from "@api/Styles"; import { useForceUpdater } from "@utils/react"; -import { Button, ContextMenuApi, Flex, FluxDispatcher, Forms, Icons, useCallback, useEffect, useRef, UserStore, useState } from "@webpack/common"; +import { findByPropsLazy } from "@webpack"; +import { Button, ContextMenuApi, Flex, FluxDispatcher, Forms, useCallback, useEffect, useRef, UserStore, useState } from "@webpack/common"; import { BasicChannelTabsProps, ChannelTabsProps, createTab, handleChannelSwitch, openedTabs, openStartupTabs, saveTabs, settings, setUpdaterFunction, useGhostTabs } from "../util"; import BookmarkContainer from "./BookmarkContainer"; @@ -15,7 +16,7 @@ import { BasicContextMenu } from "./ContextMenus"; type TabSet = Record; -const { PlusSmallIcon } = Icons; +const { PlusSmallIcon } = findByPropsLazy("PlusSmallIcon"); const cl = classNameFactory("vc-channeltabs-"); export default function ChannelsTabsContainer(props: BasicChannelTabsProps) { diff --git a/src/plusplugins/channelTabs/util/constants.ts b/src/plusplugins/channelTabs/util/constants.ts index 22a419b3a2d..45491dc8bc8 100644 --- a/src/plusplugins/channelTabs/util/constants.ts +++ b/src/plusplugins/channelTabs/util/constants.ts @@ -1,13 +1,13 @@ /* * Vencord, a Discord client mod - * Copyright (c) 2025 Vendicated and contributors + * Copyright (c) 2024 Vendicated and contributors * SPDX-License-Identifier: GPL-3.0-or-later */ import { definePluginSettings } from "@api/Settings"; import { Logger } from "@utils/Logger"; import { OptionType } from "@utils/types"; -import { Icons } from "@webpack/common"; +import { findByPropsLazy } from "@webpack"; import { ChannelTabsPreview } from "../components/ChannelTabsContainer"; @@ -74,4 +74,4 @@ export const settings = definePluginSettings({ } }); -export const { CircleQuestionIcon } = Icons; +export const { CircleQuestionIcon } = findByPropsLazy("CircleQuestionIcon");