no longer display the 'deleted' state of a snapshot, while retrieving it

This commit is contained in:
Dragos 2021-05-31 11:17:07 +03:00
parent 96c76c845b
commit 447f167e4d
1 changed files with 5 additions and 1 deletions

View File

@ -40,7 +40,11 @@ export class SnapshotsService
// Keep polling the snapshot until it reaches the expected state
return this.httpClient.get<Snapshot>(`/api/my/machines/${instance.id}/snapshots/${encodeURIComponent(snapshot.name)}`)
.pipe(
tap(x => snapshot.state = x.state),
tap(x =>
{
if (x.state !== 'deleted')
snapshot.state = x.state;
}),
repeatWhen(x =>
{
let retries = 0;