mirror of
https://github.com/System-End/Vencord.git
synced 2026-04-19 23:22:48 +00:00
fix VoiceMessages plugin
This commit is contained in:
parent
2ffa14fe2b
commit
d8dbbf0c81
2 changed files with 9 additions and 8 deletions
|
|
@ -32,7 +32,7 @@ import definePlugin from "@utils/types";
|
|||
import { chooseFile } from "@utils/web";
|
||||
import { CloudUpload as TCloudUpload } from "@vencord/discord-types";
|
||||
import { CloudUploadPlatform } from "@vencord/discord-types/enums";
|
||||
import { findCssClassesLazy, findLazy, findStoreLazy } from "@webpack";
|
||||
import { findLazy, findStoreLazy } from "@webpack";
|
||||
import { Button, Constants, FluxDispatcher, Forms, lodash, Menu, MessageActions, PermissionsBits, PermissionStore, RestAPI, SelectedChannelStore, showToast, SnowflakeUtils, Toasts, useEffect, useState } from "@webpack/common";
|
||||
import { ComponentType } from "react";
|
||||
|
||||
|
|
@ -43,7 +43,6 @@ import { VoiceRecorderWeb } from "./WebRecorder";
|
|||
|
||||
const CloudUpload: typeof TCloudUpload = findLazy(m => m.prototype?.trackUploadFinished);
|
||||
const PendingReplyStore = findStoreLazy("PendingReplyStore");
|
||||
const OptionClasses = findCssClassesLazy("optionName", "optionIcon", "optionLabel");
|
||||
|
||||
export const cl = classNameFactory("vc-vmsg-");
|
||||
export type VoiceRecorder = ComponentType<{
|
||||
|
|
@ -59,12 +58,12 @@ const ctxMenuPatch: NavContextMenuPatchCallback = (children, props) => {
|
|||
children.push(
|
||||
<Menu.MenuItem
|
||||
id="vc-send-vmsg"
|
||||
label={
|
||||
<div className={OptionClasses.optionLabel}>
|
||||
<Microphone className={OptionClasses.optionIcon} height={24} width={24} />
|
||||
<div className={OptionClasses.optionName}>Send Voice Message</div>
|
||||
</div>
|
||||
}
|
||||
iconLeft={Microphone}
|
||||
leadingAccessory={{
|
||||
type: "icon",
|
||||
icon: Microphone
|
||||
}}
|
||||
label="Send Voice Message"
|
||||
action={() => openModal(modalProps => <Modal modalProps={modalProps} />)}
|
||||
/>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -598,6 +598,8 @@ export function findCssClasses<S extends string>(...classes: S[]): Record<S, str
|
|||
|
||||
if (!res) {
|
||||
handleModuleNotFound("findCssClasses", ...classes);
|
||||
|
||||
if (IS_REPORTER) return null as any;
|
||||
return {} as Record<S, string>;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue