From b0dac561d5e9f0f7155db509956098500fe058bb Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 21 Nov 2023 09:59:07 +0000 Subject: [PATCH] Update comment --- src/e2ee/sharedKeyManagement.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/e2ee/sharedKeyManagement.ts b/src/e2ee/sharedKeyManagement.ts index 2d23f1e4..2f46c532 100644 --- a/src/e2ee/sharedKeyManagement.ts +++ b/src/e2ee/sharedKeyManagement.ts @@ -45,9 +45,10 @@ export function getKeyForRoom(roomId: string): string | null { function saveKeyFromUrlParams(urlParams: UrlParams): void { if (!urlParams.password || !urlParams.roomId) return; - // We set the Item by only using data from the url. This way we - // make sure, we always have matching pairs in the LocalStorage, - // as they occur in the call links. + // Take the key from the URL and save it. + // It's important to always use the room ID specified in the URL + // when saving keys rather than whatever the current room ID might be, + // in case we've moved to a different room but the URL hasn't changed. saveKeyForRoom(urlParams.roomId, urlParams.password); }