Skip to content

Commit

Permalink
fix: subscription side-effect
Browse files Browse the repository at this point in the history
  • Loading branch information
juanfran committed Nov 22, 2023
1 parent 4b9e7d0 commit 2598189
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { fetch, pessimisticUpdate } from '@ngrx/router-store/data-persistence';
import { Store } from '@ngrx/store';
import { TuiNotification } from '@taiga-ui/core';
import { ProjectApiService } from '@taiga/api';
import { EMPTY, catchError, map, of, switchMap, tap } from 'rxjs';
import { EMPTY, catchError, map, of, switchMap, take, tap } from 'rxjs';
import { projectEventActions } from '~/app/modules/project/data-access/+state/actions/project.actions';
import { selectCurrentProject } from '~/app/modules/project/data-access/+state/selectors/project.selectors';
import { KanbanActions } from '~/app/modules/project/feature-kanban/data-access/+state/actions/kanban.actions';
Expand Down Expand Up @@ -70,6 +70,7 @@ export class StoryDetailEffects {
]),
switchMap(([action, project]) => {
return this.store.select(selectStoryView).pipe(
take(1),
switchMap((view) => {
const fetchProject = (workflowSlug: string) => {
return this.projectApiService
Expand All @@ -88,6 +89,7 @@ export class StoryDetailEffects {
} else {
return this.store.select(selectKanbanWorkflow).pipe(
filterNil(),
take(1),
switchMap((kanbanWorkflow) => {
if (kanbanWorkflow.id === action.story.workflow.id) {
return of(
Expand Down

0 comments on commit 2598189

Please sign in to comment.