diff --git a/src/app/components/home/_dialogs/cookies/cookies.component.ts b/src/app/components/home/_dialogs/cookies/cookies.component.ts index 8e33833d8d2b4ed5ff22a02842558246c8972260..2dc0291043f7e8440afd9db20c0e7682c1fa8af3 100644 --- a/src/app/components/home/_dialogs/cookies/cookies.component.ts +++ b/src/app/components/home/_dialogs/cookies/cookies.component.ts @@ -30,7 +30,8 @@ export class CookiesComponent implements OnInit { acceptCookies() { localStorage.setItem('cookieAccepted', 'true'); - this.dialogRef.close(); + localStorage.setItem('dataProtectionConsent', 'true'); + this.dialogRef.close(true); setTimeout( () => { document.getElementById('live_announcer-button').focus(); }, 500); @@ -39,7 +40,7 @@ export class CookiesComponent implements OnInit { exitApp() { localStorage.setItem('cookieAccepted', 'false'); // TODO somehow exit the app, since the user didn't accept cookie usage - this.dialogRef.close(true); + this.dialogRef.close(false); } openDataProtection() { diff --git a/src/app/components/home/_dialogs/data-protection/data-protection.component.ts b/src/app/components/home/_dialogs/data-protection/data-protection.component.ts index ab739caa5dbb427cca92ff8f0452d38be03c0e7e..db83c0445c7f8a832f2463868d8bbf0bbe46712f 100644 --- a/src/app/components/home/_dialogs/data-protection/data-protection.component.ts +++ b/src/app/components/home/_dialogs/data-protection/data-protection.component.ts @@ -25,7 +25,7 @@ export class DataProtectionComponent implements OnInit { accept() { this.dataProtectionConsent(true); - this.dialogRef.close(); + this.dialogRef.close(true); } decline() { @@ -40,7 +40,7 @@ export class DataProtectionComponent implements OnInit { } else { // otherwise: go there this.router.navigate(['/home']); } - this.dialogRef.close(); + this.dialogRef.close(false); } /** diff --git a/src/app/components/shared/footer/footer.component.ts b/src/app/components/shared/footer/footer.component.ts index 28f0c1c6581f1ed04ac3d385721570edfc266a11..d0232ddcc6f0a70aa4aecf5dd8e5d0245cc6c637 100644 --- a/src/app/components/shared/footer/footer.component.ts +++ b/src/app/components/shared/footer/footer.component.ts @@ -32,6 +32,7 @@ export class FooterComponent implements OnInit { public open: string; public deviceType: string; public cookieAccepted: boolean; + public dataProtectionConsent: boolean; public themeClass = localStorage.getItem('theme'); @@ -60,11 +61,12 @@ export class FooterComponent implements OnInit { this.themes = this.themeService.getThemes(); this.updateScale(this.themeService.getThemeByKey(this.themeClass)); this.cookieAccepted = localStorage.getItem('cookieAccepted') === 'true'; + this.dataProtectionConsent = localStorage.getItem('dataProtectionConsent') === 'true'; if (!localStorage.getItem('cookieAccepted')) { this.showCookieModal(); } else { - if (!this.cookieAccepted) { + if (!this.cookieAccepted || !this.dataProtectionConsent) { this.showOverlay(); } } @@ -86,7 +88,9 @@ export class FooterComponent implements OnInit { dialogRef.disableClose = true; dialogRef.componentInstance.deviceType = this.deviceType; dialogRef.afterClosed().subscribe(res => { - if (res) { + this.cookieAccepted = res; + this.dataProtectionConsent = res; + if (!res) { this.showOverlay(); } }); @@ -111,6 +115,12 @@ export class FooterComponent implements OnInit { width: '80%' }); dialogRef.componentInstance.deviceType = this.deviceType; + dialogRef.afterClosed().subscribe(res => { + this.dataProtectionConsent = res; + if (!res) { + this.showOverlay(); + } + }); } showOverlay() { @@ -120,7 +130,11 @@ export class FooterComponent implements OnInit { dialogRef.disableClose = true; dialogRef.afterClosed().subscribe(res => { if (res) { - this.showCookieModal(); + if (!this.cookieAccepted) { + this.showCookieModal(); + } else if (!this.dataProtectionConsent) { + this.showDataProtection(); + } } }); }