Merge branch 'dev' into dev

This commit is contained in:
Ginger 2025-02-15 18:10:18 -05:00 committed by GitHub
commit 68ac194ed5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 30 additions and 26 deletions

View file

@ -257,7 +257,9 @@ export function Toolbar() {
const modKey = isMacOS() ? KeySymbol.Command : 'Ctrl';
const disableInline = isBlockActive(editor, BlockType.CodeBlock);
const canEscape = isAnyMarkActive(editor) || !isBlockActive(editor, BlockType.Paragraph);
const canEscape = isBlockActive(editor, BlockType.Paragraph)
? isAnyMarkActive(editor)
: ReactEditor.isFocused(editor);
const [isMarkdown, setIsMarkdown] = useSetting(settingsAtom, 'isMarkdown');
return (

View file

@ -1,5 +1,6 @@
import { MatrixEvent, MatrixEventEvent, MatrixEventHandlerMap } from 'matrix-js-sdk';
import React, { ReactNode, useEffect, useState } from 'react';
import { MessageEvent } from '../../../../types/matrix/room';
type EncryptedContentProps = {
mEvent: MatrixEvent;
@ -7,11 +8,12 @@ type EncryptedContentProps = {
};
export function EncryptedContent({ mEvent, children }: EncryptedContentProps) {
const [, toggleDecrypted] = useState(!mEvent.isBeingDecrypted());
const [, toggleEncrypted] = useState(mEvent.getType() === MessageEvent.RoomMessageEncrypted);
useEffect(() => {
const handleDecrypted: MatrixEventHandlerMap[MatrixEventEvent.Decrypted] = () => {
toggleDecrypted((s) => !s);
toggleEncrypted(mEvent.getType() === MessageEvent.RoomMessageEncrypted);
const handleDecrypted: MatrixEventHandlerMap[MatrixEventEvent.Decrypted] = (event) => {
toggleEncrypted(event.getType() === MessageEvent.RoomMessageEncrypted);
};
mEvent.on(MatrixEventEvent.Decrypted, handleDecrypted);
return () => {