Skip to content

Commit

Permalink
fix: metrics bug when switching projects directly #2790
Browse files Browse the repository at this point in the history
  • Loading branch information
johannesjo committed Sep 22, 2023
1 parent b3b9ef6 commit 3bfec3d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/app/features/metric/project-metrics.service.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Injectable } from '@angular/core';
import { combineLatest, EMPTY, from, Observable } from 'rxjs';
import { SimpleMetrics } from './metric.model';
import { map, switchMap, take } from 'rxjs/operators';
import { delay, map, switchMap, take } from 'rxjs/operators';
import { WorkContextType } from '../work-context/work-context.model';
import { mapSimpleMetrics } from './metric.util';
import { TaskService } from '../tasks/task.service';
Expand All @@ -15,6 +15,8 @@ import { WorkContextService } from '../work-context/work-context.service';
export class ProjectMetricsService {
simpleMetrics$: Observable<SimpleMetrics> =
this._workContextService.activeWorkContextTypeAndId$.pipe(
// wait for current projectId to settle in :(
delay(100),
switchMap(({ activeType, activeId }) => {
return activeType === WorkContextType.PROJECT
? combineLatest([
Expand Down

0 comments on commit 3bfec3d

Please sign in to comment.