mirror of
https://github.com/vector-im/element-call.git
synced 2024-11-15 00:04:59 +08:00
Always allow setting a password
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
parent
3ea908c59f
commit
d0fe055af6
@ -26,12 +26,12 @@ export const getRoomSharedKeyLocalStorageKey = (roomId: string): string =>
|
||||
|
||||
export const useInternalRoomSharedKey = (
|
||||
roomId: string
|
||||
): [string | null, ((value: string) => void) | null] => {
|
||||
): [string | null, (value: string) => void] => {
|
||||
const key = useMemo(() => getRoomSharedKeyLocalStorageKey(roomId), [roomId]);
|
||||
const [e2eeEnabled] = useEnableE2EE();
|
||||
const [roomSharedKey, setRoomSharedKey] = useLocalStorage(key);
|
||||
|
||||
return e2eeEnabled ? [roomSharedKey, setRoomSharedKey] : [null, null];
|
||||
return [e2eeEnabled ? roomSharedKey : null, setRoomSharedKey];
|
||||
};
|
||||
|
||||
export const useRoomSharedKey = (roomId: string): string | null => {
|
||||
@ -47,7 +47,7 @@ export const useManageRoomSharedKey = (roomId: string): string | null => {
|
||||
if (password === "") return;
|
||||
if (password === e2eeSharedKey) return;
|
||||
|
||||
setE2EESharedKey?.(password);
|
||||
setE2EESharedKey(password);
|
||||
}, [password, e2eeSharedKey, setE2EESharedKey]);
|
||||
|
||||
useEffect(() => {
|
||||
|
Loading…
Reference in New Issue
Block a user