Leave issue refactor (#3302)

* Simplify key local storage management.

* Refactor useLivekit to only ever connect to one room.
This change also tries to make the code more explicit so that we only do the things we really need to do and rely less on react updating everything correctly.

It also surfaces, that we are currently implementing useLivekit in a way, so that we can change the encryption system on the fly and recreate the room. I am not sure this is a case we need to support?

* simplify the useLivekit hook even more
This is possible because we concluded that we do not need to be able to hot reload the e2ee system.

* review

* linter

* Update src/room/InCallView.tsx

Co-authored-by: Robin <robin@robin.town>

---------

Co-authored-by: Robin <robin@robin.town>
This commit is contained in:
Timo
2025-06-04 22:51:13 +02:00
committed by GitHub
parent ef41ef85eb
commit 2f3e0b419d
6 changed files with 141 additions and 129 deletions

View File

@@ -81,8 +81,9 @@ function sortRooms(client: MatrixClient, rooms: Room[]): Room[] {
}
const roomIsJoinable = (room: Room): boolean => {
if (!room.hasEncryptionStateEvent() && !getKeyForRoom(room.roomId)) {
// if we have an non encrypted room (no encryption state event) we need a locally stored shared key.
const password = getKeyForRoom(room.roomId);
if (!room.hasEncryptionStateEvent() && !password) {
// if we have a non encrypted room (no encryption state event) we need a locally stored shared key.
// in case this key also does not exists we cannot join the room.
return false;
}