From c90440f03140d77876402a46d28851474e53815d Mon Sep 17 00:00:00 2001 From: Vendicated Date: Wed, 25 Oct 2023 18:42:31 +0200 Subject: [PATCH] Fix Settings Proto --- src/utils/discord.tsx | 7 +++---- src/webpack/common/settingsStores.ts | 2 ++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/utils/discord.tsx b/src/utils/discord.tsx index a36ecfbb..76721d04 100644 --- a/src/utils/discord.tsx +++ b/src/utils/discord.tsx @@ -17,13 +17,12 @@ */ import { MessageObject } from "@api/MessageEvents"; -import { findByCodeLazy, findByPropsLazy, findLazy } from "@webpack"; -import { ChannelStore, ComponentDispatch, FluxDispatcher, GuildStore, MaskedLink, ModalImageClasses, PrivateChannelsStore, RestAPI, SelectedChannelStore, SelectedGuildStore, UserProfileStore, UserUtils } from "@webpack/common"; +import { findByCodeLazy, findByPropsLazy } from "@webpack"; +import { ChannelStore, ComponentDispatch, FluxDispatcher, GuildStore, MaskedLink, ModalImageClasses, PrivateChannelsStore, RestAPI, SelectedChannelStore, SelectedGuildStore, UserProfileStore, UserSettingsActionCreators, UserUtils } from "@webpack/common"; import { Guild, Message, User } from "discord-types/general"; import { ImageModal, ModalRoot, ModalSize, openModal } from "./modal"; -const PreloadedUserSettings = findLazy(m => m.ProtoClass?.typeName.endsWith("PreloadedUserSettings")); const MessageActions = findByPropsLazy("editMessage", "sendMessage"); export function getCurrentChannel() { @@ -44,7 +43,7 @@ export const enum Theme { } export function getTheme(): Theme { - return PreloadedUserSettings.getCurrentValue()?.appearance?.theme; + return UserSettingsActionCreators.PreloadedUserSettingsActionCreators.getCurrentValue()?.appearance?.theme; } export function insertTextIntoChatInputBox(text: string) { diff --git a/src/webpack/common/settingsStores.ts b/src/webpack/common/settingsStores.ts index c8afb72d..6db21949 100644 --- a/src/webpack/common/settingsStores.ts +++ b/src/webpack/common/settingsStores.ts @@ -8,3 +8,5 @@ import { findByPropsLazy } from "@webpack"; export const TextAndImagesSettingsStores = findByPropsLazy("MessageDisplayCompact"); export const StatusSettingsStores = findByPropsLazy("ShowCurrentGame"); + +export const UserSettingsActionCreators = findByPropsLazy("PreloadedUserSettingsActionCreators");