Skip to content

Commit

Permalink
Fixes #2732: Only pools for selected account are shown
Browse files Browse the repository at this point in the history
Issues refreshAll() to ensure removal of stale pool items.
  • Loading branch information
gingi committed May 23, 2023
1 parent 0bbfa38 commit a109541
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions desktop/src/app/services/azure-batch/pool/pool.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { ModelUtils } from "app/utils";
import { Constants } from "common";
import { List } from "immutable";
import { Observable, Subject, of, throwError } from "rxjs";
import { catchError, map, publishReplay, refCount, switchMap } from "rxjs/operators";
import { catchError, map, share, switchMap } from "rxjs/operators";
import { AzureBatchHttpService, BatchEntityGetter, BatchListGetter } from "../core";

export interface PoolListParams { }
Expand Down Expand Up @@ -64,13 +64,11 @@ export class PoolService implements OnDestroy {
this.listView.loadNewItem(this.get(poolId));
});

this.pools = new Observable((observer) => {
const sub = this.listView.fetchAll().subscribe(observer);
return sub;
}).pipe(
switchMap(() => this.listView.items),
publishReplay(1),
refCount(),
this.pools = new Observable(
observer => this.listView.fetchAll().subscribe(observer)
).pipe(
switchMap(() => this.listView.refreshAll()),
share(),
);
}

Expand Down Expand Up @@ -106,7 +104,7 @@ export class PoolService implements OnDestroy {
}

public refresh() {
return this.listView.fetchAll();
return this.listView.refreshAll();
}

/**
Expand Down

0 comments on commit a109541

Please sign in to comment.