fix: logut works from all pages now, spinner on my apps only if there are no contracts
MODIFY
src/app/components/my-apps/my-apps.component.ts
src/app/components/my-apps/my-apps.component.ts
@@ -76,11 +76,6 @@ export class MyAppsComponent implements OnInit {
.getEditableClients()
.pipe(
switchMap((clientSummaries: IClientSummary[]) => {
- if (clientSummaries.length === 0) {
- this.spinnerService.stopWaiting();
- this.noDataFound = true;
- this.contractsLoaded = true;
- }
return forkJoin(clientSummaries.map(clientSummary => {
return this.backend.getClientVersions(
@@ -102,6 +97,11 @@ export class MyAppsComponent implements OnInit {
}),
switchMap((nestedContractSummaries: IContractSummary[][]) => {
const contractSummaries: IContractSummary[] = flatArray(nestedContractSummaries)
+ if (contractSummaries.length === 0) {
+ this.spinnerService.stopWaiting();
+ this.noDataFound = true;
+ this.contractsLoaded = true;
+ }
return forkJoin(contractSummaries.map(contractSummary => {
return this.backend.getContract(
contractSummary.clientOrganizationId,

MODIFY
src/app/services/keycloak-helper/keycloak-helper.service.ts
src/app/services/keycloak-helper/keycloak-helper.service.ts
@@ -2,6 +2,7 @@ import { Injectable } from '@angular/core';
import { KeycloakService } from 'keycloak-angular';
import { KeycloakInstance } from 'keycloak-js';
import { ConfigService } from '../config/config.service';
+import {Router} from "@angular/router";
@Injectable({
providedIn: 'root',
@@ -14,7 +15,8 @@ export class KeycloakHelperService {
constructor(
private readonly keycloak: KeycloakService,
- private configService: ConfigService
+ private configService: ConfigService,
+ private router: Router
) {}
/**
@@ -57,7 +59,8 @@ export class KeycloakHelperService {
public logout(): void {
KeycloakHelperService.clearTokensFromSessionStorage();
- const url = window.location.href.substring(0, window.location.href.lastIndexOf('/')) + '/home';
+ // remove current angular route so that the base path is still used
+ const url = window.location.href.replace(this.router.url, '') + '/home';
this.keycloak.logout(url);
}

fix: logut works from all pages now, spinner on my apps only if there are no contracts