fix: tweak re-connect

This commit is contained in:
2024-06-18 12:47:47 +01:00
parent d8e0c935b9
commit 1a405f7796
2 changed files with 13 additions and 7 deletions

View File

@ -36,7 +36,10 @@ export async function initRelayWorker() {
if (!conn) {
conn = await tryUseCacheRelay("ws://umbrel:4848");
}
if (conn) return;
if (conn) {
window.location.reload();
return;
}
} else if (Relay instanceof ConnectionCacheRelay) {
await Relay.connection.connect(true);
return;
@ -44,6 +47,9 @@ export async function initRelayWorker() {
} catch (e) {
localStorage.removeItem("cache-relay");
console.error(e);
if (cacheRelay) {
window.location.reload();
}
}
try {