From 22e453f3623f18c937d82e97c5374ad3ed4ec349 Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Thu, 5 Feb 2026 00:08:58 -0500 Subject: [PATCH] migrate SettingsRouter + more fixes --- src/Vencord.ts | 4 ++-- src/plugins/betterSessions/index.tsx | 7 +++---- src/plugins/fullSearchContext/index.tsx | 2 +- src/plugins/reviewDB/components/ReviewsView.tsx | 2 +- src/plugins/webKeybinds.web/index.ts | 2 +- src/webpack/common/utils.ts | 4 ++-- 6 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/Vencord.ts b/src/Vencord.ts index d451e9f28..86a2e8e34 100644 --- a/src/Vencord.ts +++ b/src/Vencord.ts @@ -34,6 +34,7 @@ import { debounce } from "@shared/debounce"; import { IS_WINDOWS } from "@utils/constants"; import { createAndAppendStyle } from "@utils/css"; import { StartAt } from "@utils/types"; +import { SettingsRouter } from "@webpack/common"; import { get as dsGet } from "./api/DataStore"; import { NotificationData, showNotification } from "./api/Notifications"; @@ -44,7 +45,6 @@ import { localStorage } from "./utils/localStorage"; import { relaunch } from "./utils/native"; import { checkForUpdates, update, UpdateLogger } from "./utils/updater"; import { onceReady } from "./webpack"; -import { SettingsRouter } from "./webpack/common"; import { patches } from "./webpack/patchWebpack"; if (IS_REPORTER) { @@ -68,7 +68,7 @@ async function syncSettings() { body: "We've noticed you have cloud integrations enabled in another client! Due to limitations, you will " + "need to re-authenticate to continue using them. Click here to go to the settings page to do so!", color: "var(--yellow-360)", - onClick: () => SettingsRouter.open("VencordCloud") + onClick: () => SettingsRouter.openUserSettings("vencord_cloud_panel") }); return; } diff --git a/src/plugins/betterSessions/index.tsx b/src/plugins/betterSessions/index.tsx index 78aea6133..55f2bf444 100644 --- a/src/plugins/betterSessions/index.tsx +++ b/src/plugins/betterSessions/index.tsx @@ -23,15 +23,14 @@ import { definePluginSettings } from "@api/Settings"; import ErrorBoundary from "@components/ErrorBoundary"; import { Devs } from "@utils/constants"; import definePlugin, { OptionType } from "@utils/types"; -import { findByPropsLazy, findComponentByCodeLazy, findCssClassesLazy, findStoreLazy } from "@webpack"; -import { Constants, React, RestAPI, Tooltip } from "@webpack/common"; +import { findComponentByCodeLazy, findCssClassesLazy, findStoreLazy } from "@webpack"; +import { Constants, React, RestAPI, SettingsRouter, Tooltip } from "@webpack/common"; import { RenameButton } from "./components/RenameButton"; import { Session, SessionInfo } from "./types"; import { fetchNamesFromDataStore, getDefaultName, GetOsColor, GetPlatformIcon, savedSessionsCache, saveSessionsToDataStore } from "./utils"; const AuthSessionsStore = findStoreLazy("AuthSessionsStore"); -const UserSettingsModal = findByPropsLazy("saveAccountChanges", "open"); const TimestampClasses = findCssClassesLazy("timestamp", "blockquoteContainer"); const SessionIconClasses = findCssClassesLazy("sessionIcon"); @@ -175,7 +174,7 @@ export default definePlugin({ title: "BetterSessions", body: `New session:\n${session.client_info.os} · ${session.client_info.platform} · ${session.client_info.location}`, permanent: true, - onClick: () => UserSettingsModal.open("Sessions") + onClick: () => SettingsRouter.open("sessions_panel") }); } diff --git a/src/plugins/fullSearchContext/index.tsx b/src/plugins/fullSearchContext/index.tsx index d5b9c8a1e..2f20cd53b 100644 --- a/src/plugins/fullSearchContext/index.tsx +++ b/src/plugins/fullSearchContext/index.tsx @@ -34,7 +34,7 @@ interface CopyIdMenuItemProps { } let CopyIdMenuItem: (props: CopyIdMenuItemProps) => React.ReactElement | null = NoopComponent; -waitFor(filters.componentByCode('"devmode-copy-id-".concat'), m => CopyIdMenuItem = m); +waitFor(filters.componentByCode('"cannot copy null text"'), m => CopyIdMenuItem = m); function MessageMenu({ message, channel, onHeightUpdate }) { const canReport = message.author && diff --git a/src/plugins/reviewDB/components/ReviewsView.tsx b/src/plugins/reviewDB/components/ReviewsView.tsx index 7de4044a7..675bfe614 100644 --- a/src/plugins/reviewDB/components/ReviewsView.tsx +++ b/src/plugins/reviewDB/components/ReviewsView.tsx @@ -31,7 +31,7 @@ const Transforms = findByPropsLazy("insertNodes", "textToText"); const Editor = findByPropsLazy("start", "end", "toSlateRange"); const ChatInputTypes = findByPropsLazy("FORM", "USER_PROFILE"); const InputComponent = findComponentByCodeLazy("editorClassName", "CHANNEL_TEXT_AREA"); -const createChannelRecordFromServer = findByCodeLazy(".GUILD_TEXT])", "fromServer)"); +const createChannelRecordFromServer = findByCodeLazy(".GUILD_TEXT]", "fromServer)"); interface UserProps { discordId: string; diff --git a/src/plugins/webKeybinds.web/index.ts b/src/plugins/webKeybinds.web/index.ts index 6a0da3573..783f965d9 100644 --- a/src/plugins/webKeybinds.web/index.ts +++ b/src/plugins/webKeybinds.web/index.ts @@ -55,7 +55,7 @@ export default definePlugin({ break; case ",": e.preventDefault(); - SettingsRouter.open("My Account"); + SettingsRouter.openUserSettings("my_account_panel"); break; default: if (e.key >= "1" && e.key <= "9") { diff --git a/src/webpack/common/utils.ts b/src/webpack/common/utils.ts index c76c3ead5..368d4d108 100644 --- a/src/webpack/common/utils.ts +++ b/src/webpack/common/utils.ts @@ -143,7 +143,7 @@ export const UploadHandler = { export const ApplicationAssetUtils = mapMangledModuleLazy("getAssetImage: size must === [", { fetchAssetIds: filters.byCode('.startsWith("http:")', ".dispatch({"), - getAssetFromImageURL: filters.byCode("].serialize(", ',":"'), + getAssetFromImageURL: filters.byCode("].serialize(", ":null"), getAssetImage: filters.byCode("getAssetImage: size must === ["), getAssets: filters.byCode(".assets") }); @@ -160,7 +160,7 @@ export const ChannelRouter: t.ChannelRouter = mapMangledModuleLazy('"Thread must }); export let SettingsRouter: any; -waitFor(["open", "saveAccountChanges"], m => SettingsRouter = m); +waitFor(["openUserSettings", "USER_SETTINGS_MODAL_KEY"], m => SettingsRouter = m); export const PermissionsBits: t.PermissionsBits = findLazy(m => typeof m.ADMINISTRATOR === "bigint");