Skip to content

Commit

Permalink
Update relay.service.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
miladsoft committed Sep 16, 2024
1 parent 4c1c2b4 commit 635aed4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/app/services/relay.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,11 @@ export class RelayService {
}

public connectToRelays() {
this.relays.forEach((relay) => this.connectToRelay(relay));
this.relays.forEach((relay) => {
if (!relay.connected) {
this.connectToRelay(relay);
}
});
}

public async ensureConnectedRelays(): Promise<void> {
Expand All @@ -106,6 +110,7 @@ export class RelayService {
});
}


private setupVisibilityChangeHandling() {
document.addEventListener('visibilitychange', () => {
if (document.visibilityState === 'visible') {
Expand Down

0 comments on commit 635aed4

Please sign in to comment.