From 49cc659e62d20fe43fee02f159f82975a22ef9ac Mon Sep 17 00:00:00 2001 From: paf <paf@titelfrei.de> Date: Sun, 27 Jun 2021 11:51:31 +0200 Subject: [PATCH] Remove @SkipSelf in TestControllers's Services, because it works only without (for what reason ever). --- src/app/test-controller/backend.service.ts | 15 +++++++++------ src/app/test-controller/command.service.ts | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/app/test-controller/backend.service.ts b/src/app/test-controller/backend.service.ts index 7515a60d..dc91c1ad 100644 --- a/src/app/test-controller/backend.service.ts +++ b/src/app/test-controller/backend.service.ts @@ -1,4 +1,5 @@ -import { Injectable, Inject, SkipSelf } from '@angular/core'; +/* eslint-disable no-console */ +import { Injectable, Inject } from '@angular/core'; import { HttpClient, HttpParams } from '@angular/common/http'; import { Observable, of, Subscription } from 'rxjs'; import { catchError, map, switchMap } from 'rxjs/operators'; @@ -16,8 +17,9 @@ import { ApiError } from '../app.interfaces'; export class BackendService { constructor( @Inject('SERVER_URL') private serverUrl: string, - @SkipSelf() private http: HttpClient - ) { } + private http: HttpClient + ) { + } saveUnitReview(testId: string, unitName: string, priority: number, categories: string, entry: string) : Observable<boolean> { @@ -66,7 +68,8 @@ export class BackendService { ); } - getResource(testId: string, internalKey: string, resId: string, versionning = false): Observable<TaggedString | number> { + getResource(testId: string, internalKey: string, resId: string, + versionning = false): Observable<TaggedString | number> { return this.http .get( `${this.serverUrl}test/${testId}/resource/${resId}`, @@ -110,9 +113,9 @@ export class BackendService { notifyDyingTest(testId: string): void { if (navigator.sendBeacon) { - navigator.sendBeacon(this.serverUrl + `test/${testId}/connection-lost`); + navigator.sendBeacon(`${this.serverUrl}test/${testId}/connection-lost`); } else { - fetch(this.serverUrl + `test/${testId}/connection-lost`, { + fetch(`${this.serverUrl}test/${testId}/connection-lost`, { keepalive: true, method: 'POST' }); diff --git a/src/app/test-controller/command.service.ts b/src/app/test-controller/command.service.ts index f212ccb0..05e3fe48 100644 --- a/src/app/test-controller/command.service.ts +++ b/src/app/test-controller/command.service.ts @@ -44,7 +44,7 @@ export class CommandService extends WebsocketBackendService<Command[]> implement @Inject('IS_PRODUCTION_MODE') public isProductionMode: boolean, private tcs: TestControllerService, @Inject('SERVER_URL') serverUrl: string, - @SkipSelf() protected http: HttpClient + protected http: HttpClient ) { super(serverUrl, http); -- GitLab