Skip to content

Commit

Permalink
Merge pull request #2439 from cloudfoundry-incubator/wrong-space-coun…
Browse files Browse the repository at this point in the history
…t-after-delete

Fix issue where space count is wrong after deleting a space
  • Loading branch information
nwmac authored Jun 20, 2018
2 parents 2122ffa + 1433f45 commit dca1d2d
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Injectable } from '@angular/core';
import { Route } from '@angular/router';
import { Store } from '@ngrx/store';
import { Observable } from 'rxjs';
import { Observable, combineLatest } from 'rxjs';
import { filter, map, switchMap } from 'rxjs/operators';

import { IServiceInstance } from '../../../core/cf-api-svc.types';
Expand Down Expand Up @@ -33,6 +33,7 @@ import { getOrgRolesString } from '../cf.helpers';
import { CloudFoundryEndpointService } from './cloud-foundry-endpoint.service';
import { PaginationObservables, getPaginationObservables } from '../../../store/reducers/pagination-reducer/pagination-reducer.helper';
import { CfUser } from '../../../store/types/user.types';
import { EntitiesPipelineActionTypes } from '../../../store/actions/request.actions';

@Injectable()
export class CloudFoundryOrganizationService {
Expand Down Expand Up @@ -96,7 +97,14 @@ export class CloudFoundryOrganizationService {

private initialiseObservables() {
this.org$ = this.orgEntityService.entityObs$.pipe(
filter(o => !!o && !!o.entity)
filter(o => !!o && !!o.entity),
switchMap(() => combineLatest(
this.orgEntityService.entityMonitor.entity$,
this.orgEntityService.entityMonitor.entityRequest$)),
map(([entity, entityRequestInfo]) => ({
entityRequestInfo,
entity
}))
);

this.initialiseOrgObservables();
Expand Down

0 comments on commit dca1d2d

Please sign in to comment.