mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-15 19:50:28 +03:00
Merge branch 'dev' into dev
This commit is contained in:
commit
68ac194ed5
15 changed files with 30 additions and 26 deletions
|
|
@ -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 (
|
||||
|
|
|
|||
|
|
@ -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 () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue