mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-18 02:47:03 -04:00
Fix crash when toggling chat button plugins without restart
This commit is contained in:
parent
de570a4800
commit
377def4a33
7 changed files with 13 additions and 16 deletions
|
@ -65,7 +65,7 @@ function Indicator() {
|
|||
|
||||
}
|
||||
|
||||
const ChatBarIcon: ChatBarButton = (_, isMainChat) => {
|
||||
const ChatBarIcon: ChatBarButton = ({ isMainChat }) => {
|
||||
if (!isMainChat) return null;
|
||||
|
||||
return (
|
||||
|
|
|
@ -73,9 +73,7 @@ const getAttachments = async (channelId: string) =>
|
|||
);
|
||||
|
||||
|
||||
const PreviewButton: ChatBarButton = (props, isMainChat) => {
|
||||
const { isEmpty, type: { attachments } } = props;
|
||||
|
||||
const PreviewButton: ChatBarButton = ({ isMainChat, isEmpty, type: { attachments } }) => {
|
||||
const channelId = SelectedChannelStore.getChannelId();
|
||||
const draft = useStateFromStores([DraftStore], () => getDraft(channelId));
|
||||
|
||||
|
|
|
@ -123,7 +123,7 @@ function PickerModal({ rootProps, close }: { rootProps: ModalProps, close(): voi
|
|||
);
|
||||
}
|
||||
|
||||
const ChatBarIcon: ChatBarButton = (_, isMainChat) => {
|
||||
const ChatBarIcon: ChatBarButton = ({ isMainChat }) => {
|
||||
if (!isMainChat) return null;
|
||||
|
||||
return (
|
||||
|
|
|
@ -41,7 +41,7 @@ const settings = definePluginSettings({
|
|||
}
|
||||
});
|
||||
|
||||
const SilentMessageToggle: ChatBarButton = (_, isMainChat) => {
|
||||
const SilentMessageToggle: ChatBarButton = ({ isMainChat }) => {
|
||||
const [enabled, setEnabled] = useState(lastState);
|
||||
|
||||
function setEnabledValue(value: boolean) {
|
||||
|
|
|
@ -37,7 +37,7 @@ const settings = definePluginSettings({
|
|||
}
|
||||
});
|
||||
|
||||
const SilentTypingToggle: ChatBarButton = (_, isMainChat) => {
|
||||
const SilentTypingToggle: ChatBarButton = ({ isMainChat }) => {
|
||||
const { isEnabled, showIcon } = settings.use(["isEnabled", "showIcon"]);
|
||||
const toggle = () => settings.store.isEnabled = !settings.store.isEnabled;
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ export function TranslateIcon({ height = 24, width = 24, className }: { height?:
|
|||
);
|
||||
}
|
||||
|
||||
export const TranslateChatBarIcon: ChatBarButton = (props, isMainChat) => {
|
||||
export const TranslateChatBarIcon: ChatBarButton = ({ isMainChat }) => {
|
||||
const { autoTranslate } = settings.use(["autoTranslate"]);
|
||||
|
||||
if (!isMainChat) return null;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue