From 8e15298919c2ae3b0abb243c3c6912eb97d6db68 Mon Sep 17 00:00:00 2001 From: Dan Percic Date: Mon, 4 Apr 2022 15:23:13 +0300 Subject: [PATCH] remove deprecated retryWhen --- src/lib/error/server-error-interceptor.ts | 10 +++++----- src/lib/listing/workflow/workflow.component.ts | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lib/error/server-error-interceptor.ts b/src/lib/error/server-error-interceptor.ts index e63e850..5bab388 100644 --- a/src/lib/error/server-error-interceptor.ts +++ b/src/lib/error/server-error-interceptor.ts @@ -1,7 +1,7 @@ import { HttpErrorResponse, HttpEvent, HttpHandler, HttpInterceptor, HttpRequest, HttpStatusCode } from '@angular/common/http'; import { Inject, Injectable, Optional } from '@angular/core'; -import { MonoTypeOperatorFunction, Observable, pipe, throwError, timer } from 'rxjs'; -import { catchError, mergeMap, retryWhen, tap } from 'rxjs/operators'; +import { MonoTypeOperatorFunction, Observable, pipe, retry, throwError, timer } from 'rxjs'; +import { catchError, mergeMap, tap } from 'rxjs/operators'; import { MAX_RETRIES_ON_SERVER_ERROR } from './max-retries.token'; import { ErrorService } from './error.service'; import { KeycloakService } from 'keycloak-angular'; @@ -20,7 +20,7 @@ function backoffOnServerError(maxRetries = 3): MonoTypeOperatorFunction(() => (seconds = updateSeconds(seconds))), mergeMap((error: HttpErrorResponse, index) => { if ((error.status < HttpStatusCode.InternalServerError && error.status !== 0) || index === maxRetries) { - return throwError(error); + return throwError(() => error); } console.error('An error occurred: ', error); @@ -28,7 +28,7 @@ function backoffOnServerError(maxRetries = 3): MonoTypeOperatorFunction errors.pipe(timerExpiration)); + return retry({ delay: (errors: Observable) => errors.pipe(timerExpiration) }); } @Injectable() @@ -55,7 +55,7 @@ export class ServerErrorInterceptor implements HttpInterceptor { this._urlsWithError.add(req.url); } - return throwError(error); + return throwError(() => error); }), backoffOnServerError(this._maxRetries || 3), tap(() => { diff --git a/src/lib/listing/workflow/workflow.component.ts b/src/lib/listing/workflow/workflow.component.ts index eff1ee0..9eeb534 100644 --- a/src/lib/listing/workflow/workflow.component.ts +++ b/src/lib/listing/workflow/workflow.component.ts @@ -73,7 +73,7 @@ export class WorkflowComponent extends Au if (event.previousContainer !== event.container) { const column = this._getColumnByKey((event.container.id) as K); await column.enterFn(this.draggingEntities$.value); - this.listingService.setSelected([]); // TODO: Clear only when moving selected??? + this.listingService.setSelected([]); } }