show connection bar right away (#1849)

This commit is contained in:
Matt Hill
2022-10-03 09:59:49 -06:00
committed by GitHub
parent afb4536247
commit 719cd5512c
2 changed files with 5 additions and 5 deletions

View File

@@ -1,12 +1,12 @@
import { Component } from '@angular/core' import { ChangeDetectionStrategy, Component } from '@angular/core'
import { combineLatest, map, Observable } from 'rxjs' import { combineLatest, map, Observable, startWith } from 'rxjs'
import { ConnectionService } from 'src/app/services/connection.service' import { ConnectionService } from 'src/app/services/connection.service'
@Component({ @Component({
selector: 'connection-bar', selector: 'connection-bar',
templateUrl: './connection-bar.component.html', templateUrl: './connection-bar.component.html',
styleUrls: ['./connection-bar.component.scss'], styleUrls: ['./connection-bar.component.scss'],
// changeDetection: ChangeDetectionStrategy.OnPush, changeDetection: ChangeDetectionStrategy.OnPush,
}) })
export class ConnectionBarComponent { export class ConnectionBarComponent {
private readonly websocket$ = this.connectionService.websocketConnected$ private readonly websocket$ = this.connectionService.websocketConnected$
@@ -19,7 +19,7 @@ export class ConnectionBarComponent {
dots: boolean dots: boolean
}> = combineLatest([ }> = combineLatest([
this.connectionService.networkConnected$, this.connectionService.networkConnected$,
this.websocket$, this.websocket$.pipe(startWith(false)),
]).pipe( ]).pipe(
map(([network, websocket]) => { map(([network, websocket]) => {
if (!network) if (!network)