Fix Settings Proto
This commit is contained in:
parent
baf952512c
commit
c90440f031
|
@ -17,13 +17,12 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { MessageObject } from "@api/MessageEvents";
|
import { MessageObject } from "@api/MessageEvents";
|
||||||
import { findByCodeLazy, findByPropsLazy, findLazy } from "@webpack";
|
import { findByCodeLazy, findByPropsLazy } from "@webpack";
|
||||||
import { ChannelStore, ComponentDispatch, FluxDispatcher, GuildStore, MaskedLink, ModalImageClasses, PrivateChannelsStore, RestAPI, SelectedChannelStore, SelectedGuildStore, UserProfileStore, UserUtils } from "@webpack/common";
|
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 { Guild, Message, User } from "discord-types/general";
|
||||||
|
|
||||||
import { ImageModal, ModalRoot, ModalSize, openModal } from "./modal";
|
import { ImageModal, ModalRoot, ModalSize, openModal } from "./modal";
|
||||||
|
|
||||||
const PreloadedUserSettings = findLazy(m => m.ProtoClass?.typeName.endsWith("PreloadedUserSettings"));
|
|
||||||
const MessageActions = findByPropsLazy("editMessage", "sendMessage");
|
const MessageActions = findByPropsLazy("editMessage", "sendMessage");
|
||||||
|
|
||||||
export function getCurrentChannel() {
|
export function getCurrentChannel() {
|
||||||
|
@ -44,7 +43,7 @@ export const enum Theme {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getTheme(): Theme {
|
export function getTheme(): Theme {
|
||||||
return PreloadedUserSettings.getCurrentValue()?.appearance?.theme;
|
return UserSettingsActionCreators.PreloadedUserSettingsActionCreators.getCurrentValue()?.appearance?.theme;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function insertTextIntoChatInputBox(text: string) {
|
export function insertTextIntoChatInputBox(text: string) {
|
||||||
|
|
|
@ -8,3 +8,5 @@ import { findByPropsLazy } from "@webpack";
|
||||||
|
|
||||||
export const TextAndImagesSettingsStores = findByPropsLazy("MessageDisplayCompact");
|
export const TextAndImagesSettingsStores = findByPropsLazy("MessageDisplayCompact");
|
||||||
export const StatusSettingsStores = findByPropsLazy("ShowCurrentGame");
|
export const StatusSettingsStores = findByPropsLazy("ShowCurrentGame");
|
||||||
|
|
||||||
|
export const UserSettingsActionCreators = findByPropsLazy("PreloadedUserSettingsActionCreators");
|
||||||
|
|
Loading…
Reference in a new issue