diff --git a/src/components/Icons.tsx b/src/components/Icons.tsx index d0d2ecbe8..e48cfe5f1 100644 --- a/src/components/Icons.tsx +++ b/src/components/Icons.tsx @@ -18,7 +18,7 @@ import "./iconStyles.css"; -import { getIntlMessage, getTheme, Theme } from "@utils/discord"; +import { getIntlMessage } from "@utils/discord"; import { classes } from "@utils/misc"; import type { PropsWithChildren } from "react"; @@ -122,8 +122,8 @@ export function InfoIcon(props: IconProps) { > ); @@ -211,9 +211,10 @@ export function CogWheel(props: IconProps) { viewBox="0 0 24 24" > ); @@ -406,23 +407,30 @@ export function PencilIcon(props: IconProps) { ); } -const WebsiteIconDark = "/assets/e1e96d89e192de1997f73730db26e94f.svg"; -const WebsiteIconLight = "/assets/730f58bcfd5a57a5e22460c445a0c6cf.svg"; -const GithubIconLight = "/assets/3ff98ad75ac94fa883af5ed62d17c459.svg"; -const GithubIconDark = "/assets/6a853b4c87fce386cbfef4a2efbacb09.svg"; - -export function GithubIcon(props: ImageProps) { - const src = getTheme() === Theme.Light - ? GithubIconLight - : GithubIconDark; - - return ; +export function GithubIcon(props: IconProps) { + return ( + + + + ); } -export function WebsiteIcon(props: ImageProps) { - const src = getTheme() === Theme.Light - ? WebsiteIconLight - : WebsiteIconDark; - - return ; +export function WebsiteIcon(props: IconProps) { + return ( + + + + ); } diff --git a/src/components/PluginSettings/LinkIconButton.tsx b/src/components/PluginSettings/LinkIconButton.tsx index dd840f52e..4dae0e1e9 100644 --- a/src/components/PluginSettings/LinkIconButton.tsx +++ b/src/components/PluginSettings/LinkIconButton.tsx @@ -6,16 +6,19 @@ import "./LinkIconButton.css"; +import { getTheme, Theme } from "@utils/discord"; import { MaskedLink, Tooltip } from "@webpack/common"; import { GithubIcon, WebsiteIcon } from ".."; export function GithubLinkIcon() { - return ; + const theme = getTheme() === Theme.Light ? "#000000" : "#FFFFFF"; + return ; } export function WebsiteLinkIcon() { - return ; + const theme = getTheme() === Theme.Light ? "#000000" : "#FFFFFF"; + return ; } interface Props { diff --git a/src/plugins/clientTheme/index.tsx b/src/plugins/clientTheme/index.tsx index 7e6484276..4c1668aae 100644 --- a/src/plugins/clientTheme/index.tsx +++ b/src/plugins/clientTheme/index.tsx @@ -110,7 +110,7 @@ const settings = definePluginSettings({ export default definePlugin({ name: "ClientTheme", - authors: [Devs.F53, Devs.Nuckyz], + authors: [Devs.Nuckyz], description: "Recreation of the old client theme experiment. Add a color to your Discord client theme", settings, diff --git a/src/plugins/consoleJanitor/index.ts b/src/plugins/consoleJanitor/index.ts index a02fcad1b..2c29bf670 100644 --- a/src/plugins/consoleJanitor/index.ts +++ b/src/plugins/consoleJanitor/index.ts @@ -130,27 +130,6 @@ export default definePlugin({ replace: "" } }, - // Zustand section - { - find: "[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.", - replacement: [ - { - match: /&&console\.warn\("\[DEPRECATED\] Passing a vanilla store will be unsupported in a future version\. Instead use `import { useStore } from 'zustand'`\."\)/, - replace: "" - }, - { - match: /console\.warn\("\[DEPRECATED\] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`\. They can be imported from 'zustand\/traditional'\. https:\/\/github\.com\/pmndrs\/zustand\/discussions\/1937"\),/, - replace: "" - } - ] - }, - { - find: "[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead.", - replacement: { - match: /console\.warn\("\[DEPRECATED\] `getStorage`, `serialize` and `deserialize` options are deprecated\. Use `storage` option instead\."\),/, - replace: "" - } - }, // Patches discords generic logger function { find: "Σ:", diff --git a/src/plugins/decor/ui/modals/ChangeDecorationModal.tsx b/src/plugins/decor/ui/modals/ChangeDecorationModal.tsx index 6501e0feb..a3edc0978 100644 --- a/src/plugins/decor/ui/modals/ChangeDecorationModal.tsx +++ b/src/plugins/decor/ui/modals/ChangeDecorationModal.tsx @@ -10,6 +10,7 @@ import { openInviteModal } from "@utils/discord"; import { Margins } from "@utils/margins"; import { classes, copyWithToast } from "@utils/misc"; import { closeAllModals, ModalCloseButton, ModalContent, ModalFooter, ModalHeader, ModalProps, ModalRoot, ModalSize, openModal } from "@utils/modal"; +import { Queue } from "@utils/Queue"; import { findComponentByCodeLazy } from "@webpack"; import { Alerts, Button, FluxDispatcher, Forms, GuildStore, NavigationRouter, Parser, Text, Tooltip, useEffect, UserStore, UserUtils, useState } from "@webpack/common"; import { User } from "discord-types/general"; @@ -49,6 +50,8 @@ interface SectionHeaderProps { section: Section; } +const fetchAuthorsQueue = new Queue(); + function SectionHeader({ section }: SectionHeaderProps) { const hasSubtitle = typeof section.subtitle !== "undefined"; const hasAuthorIds = typeof section.authorIds !== "undefined"; @@ -56,17 +59,18 @@ function SectionHeader({ section }: SectionHeaderProps) { const [authors, setAuthors] = useState([]); useEffect(() => { - (async () => { + fetchAuthorsQueue.push(async () => { if (!section.authorIds) return; for (const authorId of section.authorIds) { - const author = UserStore.getUser(authorId) ?? await UserUtils.getUser(authorId); + const author = UserStore.getUser(authorId) ?? await UserUtils.getUser(authorId).catch(() => null); + if (author == null) continue; + setAuthors(authors => [...authors, author]); } - })(); + }); }, [section.authorIds]); - return
{section.title} diff --git a/src/plugins/decor/ui/modals/CreateDecorationModal.tsx b/src/plugins/decor/ui/modals/CreateDecorationModal.tsx index 57a39540d..eb39c16df 100644 --- a/src/plugins/decor/ui/modals/CreateDecorationModal.tsx +++ b/src/plugins/decor/ui/modals/CreateDecorationModal.tsx @@ -119,7 +119,7 @@ function CreateDecorationModal(props: ModalProps) { />
- + To receive updates on your decoration's review, join { diff --git a/src/plugins/emoteCloner/index.tsx b/src/plugins/emoteCloner/index.tsx index 6dd3eb300..1b26e2f05 100644 --- a/src/plugins/emoteCloner/index.tsx +++ b/src/plugins/emoteCloner/index.tsx @@ -310,7 +310,8 @@ function buildMenuItem(type: "Emoji" | "Sticker", fetchData: () => Promisable { diff --git a/src/plugins/openInApp/index.ts b/src/plugins/openInApp/index.ts index 1e4f30412..2d27c2b20 100644 --- a/src/plugins/openInApp/index.ts +++ b/src/plugins/openInApp/index.ts @@ -87,7 +87,7 @@ export default definePlugin({ { find: "trackAnnouncementMessageLinkClicked({", replacement: { - match: /function (\i\(\i,\i\)\{)(?=.{0,100}trusted:)/, + match: /function (\i\(\i,\i\)\{)(?=.{0,150}trusted:)/, replace: "async function $1 if(await $self.handleLink(...arguments)) return;" } }, diff --git a/src/plugins/roleColorEverywhere/index.tsx b/src/plugins/roleColorEverywhere/index.tsx index 090c35d3a..7b811943d 100644 --- a/src/plugins/roleColorEverywhere/index.tsx +++ b/src/plugins/roleColorEverywhere/index.tsx @@ -156,7 +156,7 @@ export default definePlugin({ find: "#{intl::MESSAGE_EDITED}", replacement: { match: /(?<=isUnsupported\]:(\i)\.isUnsupported\}\),)(?=children:\[)/, - replace: "style:$self.useMessageColorStyle($1)," + replace: "style:$self.useMessageColorsStyle($1)," }, predicate: () => settings.store.colorChatMessages } @@ -188,13 +188,19 @@ export default definePlugin({ }; }, - useMessageColor(message: any) { + useMessageColorsStyle(message: any) { try { const { messageSaturation } = settings.use(["messageSaturation"]); const author = useMessageAuthor(message); if (author.colorString != null && messageSaturation !== 0) { - return `color-mix(in oklab, ${author.colorString} ${messageSaturation}%, var(--text-normal))`; + const value = `color-mix(in oklab, ${author.colorString} ${messageSaturation}%, var({DEFAULT}))`; + + return { + color: value.replace("{DEFAULT}", "--text-normal"), + "--header-primary": value.replace("{DEFAULT}", "--header-primary"), + "--text-muted": value.replace("{DEFAULT}", "--text-muted") + }; } } catch (e) { new Logger("RoleColorEverywhere").error("Failed to get message color", e); @@ -203,14 +209,6 @@ export default definePlugin({ return null; }, - useMessageColorStyle(message: any) { - const color = this.useMessageColor(message); - - return color && { - color - }; - }, - RoleGroupColor: ErrorBoundary.wrap(({ id, count, title, guildId, label }: { id: string; count: number; title: string; guildId: string; label: string; }) => { const role = GuildStore.getRole(guildId, id); diff --git a/src/plugins/showHiddenChannels/index.tsx b/src/plugins/showHiddenChannels/index.tsx index ba3675428..6b67aee8b 100644 --- a/src/plugins/showHiddenChannels/index.tsx +++ b/src/plugins/showHiddenChannels/index.tsx @@ -103,7 +103,7 @@ export default definePlugin({ replacement: [ { // Do not show confirmation to join a voice channel when already connected to another if clicking on a hidden voice channel - match: /(?<=getBlockedUsersForVoiceChannel\((\i)\.id\);return\()/, + match: /(?<=getIgnoredUsersForVoiceChannel\((\i)\.id\);return\()/, replace: (_, channel) => `!$self.isHiddenChannel(${channel})&&` }, { diff --git a/src/plugins/showHiddenThings/index.ts b/src/plugins/showHiddenThings/index.ts index 8fd6ef82e..9f6fd2a90 100644 --- a/src/plugins/showHiddenThings/index.ts +++ b/src/plugins/showHiddenThings/index.ts @@ -107,7 +107,7 @@ export default definePlugin({ predicate: () => settings.store.disableDisallowedDiscoveryFilters, all: true, replacement: { - match: /\i\.\i\.get\(\{url:\i\.\i\.GUILD_DISCOVERY_VALID_TERM,query:\{term:\i\},oldFormErrors:!0\}\)/g, + match: /\i\.\i\.get\(\{url:\i\.\i\.GUILD_DISCOVERY_VALID_TERM,query:\{term:\i\},oldFormErrors:!0,rejectWithError:!1\}\)/g, replace: "Promise.resolve({ body: { valid: true } })" } } diff --git a/src/utils/constants.ts b/src/utils/constants.ts index 1877f3cf2..40ada0f5b 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -267,10 +267,6 @@ export const Devs = /* #__PURE__*/ Object.freeze({ name: "arHSM", id: 841509053422632990n }, - F53: { - name: "Cassie (Code)", - id: 280411966126948353n - }, AutumnVN: { name: "AutumnVN", id: 393694671383166998n diff --git a/src/webpack/common/utils.ts b/src/webpack/common/utils.ts index 4b1959b5a..dc337a2ef 100644 --- a/src/webpack/common/utils.ts +++ b/src/webpack/common/utils.ts @@ -163,8 +163,8 @@ waitFor(["open", "saveAccountChanges"], m => SettingsRouter = m); export const PermissionsBits: t.PermissionsBits = findLazy(m => typeof m.ADMINISTRATOR === "bigint"); -export const { zustandCreate } = mapMangledModuleLazy(["useSyncExternalStoreWithSelector:", "Object.assign", /(\i)\?(\i)\(\1\):\2/], { - zustandCreate: filters.byCode(/(\i)\?(\i)\(\1\):\2/) +export const { zustandCreate } = mapMangledModuleLazy(["useSyncExternalStoreWithSelector:", "Object.assign"], { + zustandCreate: filters.byCode(/=>(\i)\?\i\(\1/) }); export const { zustandPersist } = mapMangledModuleLazy(".onRehydrateStorage)?", {