Apply prettier formatting
This commit is contained in:
parent
1cac306093
commit
526645c791
1576 changed files with 65385 additions and 62478 deletions
|
@ -27,11 +27,14 @@ import { useTypedEventEmitter } from "./useEventEmitter";
|
|||
export function useIsEncrypted(cli: MatrixClient, room?: Room): boolean | undefined {
|
||||
const [isEncrypted, setIsEncrypted] = useState(room ? cli.isRoomEncrypted(room.roomId) : undefined);
|
||||
|
||||
const update = useCallback((event: MatrixEvent) => {
|
||||
if (room && event.getType() === EventType.RoomEncryption) {
|
||||
setIsEncrypted(cli.isRoomEncrypted(room.roomId));
|
||||
}
|
||||
}, [cli, room]);
|
||||
const update = useCallback(
|
||||
(event: MatrixEvent) => {
|
||||
if (room && event.getType() === EventType.RoomEncryption) {
|
||||
setIsEncrypted(cli.isRoomEncrypted(room.roomId));
|
||||
}
|
||||
},
|
||||
[cli, room],
|
||||
);
|
||||
useTypedEventEmitter(room?.currentState, RoomStateEvent.Events, update);
|
||||
|
||||
return isEncrypted;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue