fix: manually connect to local cache relay

closes #751
This commit is contained in:
2024-09-13 11:58:54 +01:00
parent ae943ce173
commit 0faf903ef0
4 changed files with 56 additions and 18 deletions

View File

@ -29,18 +29,17 @@ async function tryUseCacheRelay(url: string) {
}
}
export async function tryUseLocalRelay() {
let conn = await tryUseCacheRelay("ws://localhost:4869");
if (!conn) {
conn = await tryUseCacheRelay("ws://umbrel:4848");
}
return conn;
}
export async function initRelayWorker() {
try {
if (!cacheRelay) {
let conn = await tryUseCacheRelay("ws://localhost:4869");
if (!conn) {
conn = await tryUseCacheRelay("ws://umbrel:4848");
}
if (conn) {
window.location.reload();
return;
}
} else if (Relay instanceof ConnectionCacheRelay) {
if (Relay instanceof ConnectionCacheRelay) {
await Relay.connection.connect(true);
return;
}