Skip to content

Commit

Permalink
Don't reload when passing through cookie flag (#298)
Browse files Browse the repository at this point in the history
  • Loading branch information
benfl3713 authored Feb 12, 2024
1 parent 804d8a8 commit 70220c7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
3 changes: 1 addition & 2 deletions DepartureBoardWeb/ClientApp/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -80,7 +80,6 @@ export class AppComponent implements AfterViewChecked {
`{"action":"reject","categories":"[]"}`,
90
);
window.location.reload();
}

if (params.token) {
Expand Down
14 changes: 11 additions & 3 deletions DepartureBoardWeb/ClientApp/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,17 @@
"ga"
);
</script>
<!--Start Cookie Script-->
<script defer type="text/javascript" charset="UTF-8"
src="//cookie-script.com/s/c7ef430072f63af9e12f02467db17d57.js"></script>

<script>
const url = window.location.href;
if (!url.includes('acceptCookies')) {
const cookieScript = document.createElement('script');
cookieScript.src = '//cookie-script.com/s/c7ef430072f63af9e12f02467db17d57.js';
cookieScript.type = 'text/javascript';
cookieScript.charset = 'UTF-8';
document.head.appendChild(cookieScript);
}
</script>
<!--End Cookie Script-->

<noscript style="color: #ff9729; padding-top: 100px;">Please enable JavaScript to continue using this
Expand Down

0 comments on commit 70220c7

Please sign in to comment.