From 70220c727a0ad77e761014acdebb7229a131a6db Mon Sep 17 00:00:00 2001
From: Ben Fletcher <44288013+benfl3713@users.noreply.github.com>
Date: Mon, 12 Feb 2024 17:22:42 +0000
Subject: [PATCH] Don't reload when passing through cookie flag (#298)
---
.../ClientApp/src/app/app.component.ts | 3 +--
DepartureBoardWeb/ClientApp/src/index.html | 14 +++++++++++---
2 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/DepartureBoardWeb/ClientApp/src/app/app.component.ts b/DepartureBoardWeb/ClientApp/src/app/app.component.ts
index 83ed346..c0ec37e 100644
--- a/DepartureBoardWeb/ClientApp/src/app/app.component.ts
+++ b/DepartureBoardWeb/ClientApp/src/app/app.component.ts
@@ -69,7 +69,7 @@ export class AppComponent implements AfterViewChecked {
`{"action":"accept","categories":"[\\"targeting\\",\\"unclassified\\"]"}`,
90
);
- window.location.reload();
+ window.dispatchEvent(new Event("CookieScriptAcceptAll"));
} else if (
params.acceptCookies == "false" &&
!cookieService.check("CookieScriptConsent")
@@ -80,7 +80,6 @@ export class AppComponent implements AfterViewChecked {
`{"action":"reject","categories":"[]"}`,
90
);
- window.location.reload();
}
if (params.token) {
diff --git a/DepartureBoardWeb/ClientApp/src/index.html b/DepartureBoardWeb/ClientApp/src/index.html
index c02e6f4..0d8d275 100644
--- a/DepartureBoardWeb/ClientApp/src/index.html
+++ b/DepartureBoardWeb/ClientApp/src/index.html
@@ -59,9 +59,17 @@
"ga"
);
-
-
+
+