Fix critical issue with root path

Remove_explore
George Kalampokis 4 years ago
parent 6cc77468c5
commit 20d0d8b648

@ -15,6 +15,8 @@ import { CookieService } from "ngx-cookie-service";
import { LanguageService } from './core/services/language/language.service';
import { ConfigurationService } from './core/services/configuration/configuration.service';
import { Location } from '@angular/common';
declare const gapi: any;
declare var $: any;
@ -30,7 +32,7 @@ export class AppComponent implements OnInit {
sideNavOpen = false;
helpContentEnabled: boolean;
private statusChangeSubscription: Subscription;
onlySplash = true;
onlySplash = false;
constructor(
private router: Router,
@ -43,7 +45,8 @@ export class AppComponent implements OnInit {
private cookieService: CookieService,
private ccService: NgcCookieConsentService,
private language: LanguageService,
private configurationService: ConfigurationService
private configurationService: ConfigurationService,
private location: Location
) {
this.initializeServices();
this.helpContentEnabled = configurationService.helpService.enabled;
@ -58,12 +61,18 @@ export class AppComponent implements OnInit {
}
ngOnInit() {
if (!this.configurationService.useSplash) {
this.onlySplash = false;
this.router.navigate(['/reload']).then(() => this.router.navigate(['/home']));
} else {
if (this.location.path() === '') {
if (!this.configurationService.useSplash) {
this.onlySplash = false;
this.router.navigate(['/reload']).then(() => this.router.navigate(['/home']));
} else {
this.onlySplash = true;
this.router.navigate(['/reload']).then(() => this.router.navigate(['/splash']));
}
} else if (this.location.path() === '/splash') {
this.onlySplash = true;
this.router.navigate(['/reload']).then(() => this.router.navigate(['/splash']));
} else {
this.onlySplash = false;
}
if (!this.cookieService.check("cookiesConsent")) {
this.cookieService.set("cookiesConsent", "false", 356);

Loading…
Cancel
Save