From 130d2b849eb3f521ee3399db0ea3f7c94da96220 Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Tue, 28 Jan 2025 07:55:29 -0500 Subject: [PATCH] Revert "Some Fixes" This reverts commit 2f84287fc5f7f70b835ec0a9d1078b4f9e46d4a1. --- .../components/BookmarkContainer.tsx | 5 +++-- .../channelTabs/components/ChannelTab.tsx | 4 ++-- .../components/ChannelTabsContainer.tsx | 5 +++-- .../channelTabs/util/constants.ts | 4 ++-- src/equicordplugins/keywordNotify/index.tsx | 21 ++++++++++--------- 5 files changed, 21 insertions(+), 18 deletions(-) diff --git a/src/equicordplugins/channelTabs/components/BookmarkContainer.tsx b/src/equicordplugins/channelTabs/components/BookmarkContainer.tsx index ac734e1c..ecc1f538 100644 --- a/src/equicordplugins/channelTabs/components/BookmarkContainer.tsx +++ b/src/equicordplugins/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/equicordplugins/channelTabs/components/ChannelTab.tsx b/src/equicordplugins/channelTabs/components/ChannelTab.tsx index 4d189e7e..3bdd20ce 100644 --- a/src/equicordplugins/channelTabs/components/ChannelTab.tsx +++ b/src/equicordplugins/channelTabs/components/ChannelTab.tsx @@ -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/equicordplugins/channelTabs/components/ChannelTabsContainer.tsx b/src/equicordplugins/channelTabs/components/ChannelTabsContainer.tsx index 7b30a42a..b1181b53 100644 --- a/src/equicordplugins/channelTabs/components/ChannelTabsContainer.tsx +++ b/src/equicordplugins/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/equicordplugins/channelTabs/util/constants.ts b/src/equicordplugins/channelTabs/util/constants.ts index 18f2c9b2..45491dc8 100644 --- a/src/equicordplugins/channelTabs/util/constants.ts +++ b/src/equicordplugins/channelTabs/util/constants.ts @@ -7,7 +7,7 @@ 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"); diff --git a/src/equicordplugins/keywordNotify/index.tsx b/src/equicordplugins/keywordNotify/index.tsx index 586e2215..621755b0 100644 --- a/src/equicordplugins/keywordNotify/index.tsx +++ b/src/equicordplugins/keywordNotify/index.tsx @@ -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" + } } ],