From 10f1ea5a68d2786d1190c7e8952b0b5c2d99d4dc Mon Sep 17 00:00:00 2001 From: Johannes Millan Date: Wed, 28 Oct 2020 11:48:34 +0100 Subject: [PATCH] fix: always make sure all data is loaded before loading context data #600 --- src/app/features/work-context/work-context.service.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app/features/work-context/work-context.service.ts b/src/app/features/work-context/work-context.service.ts index f9e9a3b42..fc41f2d36 100644 --- a/src/app/features/work-context/work-context.service.ts +++ b/src/app/features/work-context/work-context.service.ts @@ -67,7 +67,8 @@ export class WorkContextService { // CONTEXT LEVEL // ------------- - activeWorkContextId$: Observable = this._store$.pipe( + activeWorkContextId$: Observable = this._isAllDataLoaded$.pipe( + switchMap(() => this._store$), select(selectActiveContextId), distinctUntilChanged(), shareReplay(1), @@ -77,7 +78,8 @@ export class WorkContextService { activeWorkContextTypeAndId$: Observable<{ activeId: string; activeType: WorkContextType; - }> = this._store$.pipe( + }> = this._isAllDataLoaded$.pipe( + switchMap(() => this._store$), select(selectActiveContextTypeAndId), distinctUntilChanged(distinctUntilChangedObject), shareReplay(1),