From c977bb0898e26fa3d3c32b6c533b2b3d5e37c439 Mon Sep 17 00:00:00 2001 From: argirok Date: Fri, 15 Dec 2023 11:26:28 +0200 Subject: [PATCH] [angular-16-irish-monitor | DONE | FIXED] cookie: set properly cookie when cookie name is not default --- sharedComponents/cookie-law/cookie-law.component.ts | 3 ++- sharedComponents/cookie-law/cookie-law.service.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/sharedComponents/cookie-law/cookie-law.component.ts b/sharedComponents/cookie-law/cookie-law.component.ts index b7dc060a..bb2a08bd 100644 --- a/sharedComponents/cookie-law/cookie-law.component.ts +++ b/sharedComponents/cookie-law/cookie-law.component.ts @@ -109,10 +109,11 @@ export class CookieLawComponent implements OnInit { this.isSeenEvt = new EventEmitter(); this.animation = 'topIn'; this._position = 'bottom'; - this.cookieLawSeen = this._service.seen(this.cookieName); + } ngOnInit(): void { + this.cookieLawSeen = this._service.seen(this.cookieName); if (typeof document !== 'undefined') { this.animation = this.position === 'bottom' ? 'bottomIn' : 'topIn'; diff --git a/sharedComponents/cookie-law/cookie-law.service.ts b/sharedComponents/cookie-law/cookie-law.service.ts index a0819074..dd497d7d 100644 --- a/sharedComponents/cookie-law/cookie-law.service.ts +++ b/sharedComponents/cookie-law/cookie-law.service.ts @@ -17,7 +17,7 @@ export class CookieLawService { } storeCookie(cookieName): void { - return this.setCookie('cookieName'); + return this.setCookie(cookieName); } /**