fix: always make sure all data is loaded before loading context data #600

This commit is contained in:
Johannes Millan 2020-10-28 11:48:34 +01:00
parent c9a4e8270b
commit 10f1ea5a68

View file

@ -67,7 +67,8 @@ export class WorkContextService {
// CONTEXT LEVEL // CONTEXT LEVEL
// ------------- // -------------
activeWorkContextId$: Observable<string | null> = this._store$.pipe( activeWorkContextId$: Observable<string | null> = this._isAllDataLoaded$.pipe(
switchMap(() => this._store$),
select(selectActiveContextId), select(selectActiveContextId),
distinctUntilChanged(), distinctUntilChanged(),
shareReplay(1), shareReplay(1),
@ -77,7 +78,8 @@ export class WorkContextService {
activeWorkContextTypeAndId$: Observable<{ activeWorkContextTypeAndId$: Observable<{
activeId: string; activeId: string;
activeType: WorkContextType; activeType: WorkContextType;
}> = this._store$.pipe( }> = this._isAllDataLoaded$.pipe(
switchMap(() => this._store$),
select(selectActiveContextTypeAndId), select(selectActiveContextTypeAndId),
distinctUntilChanged(distinctUntilChangedObject), distinctUntilChanged(distinctUntilChangedObject),
shareReplay(1), shareReplay(1),