fix firefox private

This commit is contained in:
_Bastler
2022-01-12 10:56:47 +01:00
parent fa4cd34c49
commit f9f2370afb
3 changed files with 13 additions and 3 deletions
+7 -3
View File
@@ -139,9 +139,13 @@ class LocalUserStore {
async setLastRoomUrl(roomUrl: string): Promise<void> {
localStorage.setItem(lastRoomUrl, roomUrl.toString());
if ("caches" in window) {
const cache = await caches.open(cacheAPIIndex);
const stringResponse = new Response(JSON.stringify({ roomUrl }));
await cache.put(`/${lastRoomUrl}`, stringResponse);
try {
const cache = await caches.open(cacheAPIIndex);
const stringResponse = new Response(JSON.stringify({ roomUrl }));
await cache.put(`/${lastRoomUrl}`, stringResponse);
} catch (e) {
console.error("Could not store last room url in Browser cache. Are you using private browser mode?", e);
}
}
}
getLastRoomUrl(): string {