fix: address TODOs and close dialogs upon state change

This commit is contained in:
waterplea
2024-07-31 11:57:56 +04:00
parent 972ee8e42e
commit 6168a006f4
3 changed files with 18 additions and 4 deletions

View File

@@ -5,6 +5,7 @@ import {
bufferTime,
catchError,
filter,
skip,
startWith,
switchMap,
take,
@@ -41,8 +42,8 @@ export class PatchDbSource extends Observable<Update<DataModel>[]> {
catchError((_, original$) => {
this.state.retrigger()
// @TODO Alex this is returning right away and crashing the browser, but we need to wait until state emits again from the retrigger() above.
return this.state.pipe(
skip(1), // skipping previous value stored due to shareReplay
filter(current => current === 'running'),
take(1),
switchMap(() => original$),