fix setLocalStorageItemReactive

This commit is contained in:
Timo
2025-06-05 19:26:17 +02:00
parent 5332970dcf
commit 3572de499d

View File

@@ -7,13 +7,19 @@ Please see LICENSE in the repository root for full details.
import { useEffect, useMemo } from "react"; import { useEffect, useMemo } from "react";
import { setLocalStorageItem, useLocalStorage } from "../useLocalStorage"; import {
setLocalStorageItemReactive,
useLocalStorage,
} from "../useLocalStorage";
import { type UrlParams, getUrlParams, useUrlParams } from "../UrlParams"; import { type UrlParams, getUrlParams, useUrlParams } from "../UrlParams";
import { E2eeType } from "./e2eeType"; import { E2eeType } from "./e2eeType";
import { useClient } from "../ClientContext"; import { useClient } from "../ClientContext";
export function saveKeyForRoom(roomId: string, password: string): void { export function saveKeyForRoom(roomId: string, password: string): void {
setLocalStorageItem(getRoomSharedKeyLocalStorageKey(roomId), password); setLocalStorageItemReactive(
getRoomSharedKeyLocalStorageKey(roomId),
password,
);
} }
const getRoomSharedKeyLocalStorageKey = (roomId: string): string => const getRoomSharedKeyLocalStorageKey = (roomId: string): string =>