Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't reload when passing through cookie flag #298

Merged
merged 1 commit into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading