diff --git a/src/hooks/useIsEncrypted.ts b/src/hooks/useIsEncrypted.ts index e7ede593f5b..33993f8ae8e 100644 --- a/src/hooks/useIsEncrypted.ts +++ b/src/hooks/useIsEncrypted.ts @@ -11,9 +11,9 @@ import { MatrixClient, MatrixEvent, Room, RoomStateEvent, EventType } from "matr import { useTypedEventEmitter } from "./useEventEmitter"; -// Hook to simplify watching whether a Matrix room is encrypted, returns undefined if room is undefined or when isRoomEncrypted is computed -export function useIsEncrypted(cli: MatrixClient, room?: Room): boolean | undefined { - const [isEncrypted, setIsEncrypted] = useState(); +// Hook to simplify watching whether a Matrix room is encrypted, returns undefined if room is undefined, return null when isRoomEncrypted is computed +export function useIsEncrypted(cli: MatrixClient, room?: Room): boolean | undefined | null { + const [isEncrypted, setIsEncrypted] = useState(null); useEffect(() => { const func = async (): Promise =>