mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-08 06:03:03 -04:00
TypingTweaks: fix (#1883)
This commit is contained in:
parent
c7a20769f9
commit
ab1b002ed1
3 changed files with 21 additions and 19 deletions
|
@ -17,13 +17,14 @@
|
|||
*/
|
||||
|
||||
import { MessageObject } from "@api/MessageEvents";
|
||||
import { findByCodeLazy, findByPropsLazy } from "@webpack";
|
||||
import { 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 MessageActions = findByPropsLazy("editMessage", "sendMessage");
|
||||
const UserProfileActions = findByPropsLazy("openUserProfileModal", "closeUserProfileModal");
|
||||
|
||||
export function getCurrentChannel() {
|
||||
return ChannelStore.getChannel(SelectedChannelStore.getChannelId());
|
||||
|
@ -99,14 +100,12 @@ export function openImageModal(url: string, props?: Partial<React.ComponentProps
|
|||
));
|
||||
}
|
||||
|
||||
const openProfile = findByCodeLazy("friendToken", "USER_PROFILE_MODAL_OPEN");
|
||||
|
||||
export async function openUserProfile(id: string) {
|
||||
const user = await UserUtils.getUser(id);
|
||||
if (!user) throw new Error("No such user: " + id);
|
||||
|
||||
const guildId = SelectedGuildStore.getGuildId();
|
||||
openProfile({
|
||||
UserProfileActions.openUserProfileModal({
|
||||
userId: id,
|
||||
guildId,
|
||||
channelId: SelectedChannelStore.getChannelId(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue