ui: concatObValues + comments

This commit is contained in:
Aaron Greenspan
2021-02-15 13:12:20 -07:00
committed by Aiden McClelland
parent 8ce43d808e
commit 397236c68e
7 changed files with 88 additions and 65 deletions

View File

@@ -15,9 +15,6 @@ export class SyncDaemon {
private readonly syncInterval = 5000
private readonly $sync$ = new BehaviorSubject(false)
// emits on every successful sync
private readonly $synced$ = new Subject<void>()
constructor (
private readonly apiService: ApiService,
private readonly serverModel: ServerModel,
@@ -39,15 +36,10 @@ export class SyncDaemon {
return from(this.getServerAndApps()).pipe(
concatMap(() => this.syncNotifier.handleSpecial(this.serverModel.peek())),
concatMap(() => this.startupAlertsNotifier.runChecks(this.serverModel.peek())),
tap(() => this.$synced$.next()),
catchError(e => of(console.error(`Exception in sync service`, e))),
)
}
watchSynced (): Observable<void> {
return this.$synced$.asObservable()
}
private async getServerAndApps (): Promise<void> {
const now = new Date()
const [serverRes, appsRes] = await tryAll([