mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-16 16:34:47 -05:00
Taken from GOVUK components: https://github.com/alphagov/govuk_publishing_components/blob/master/app/assets/javascripts/govuk_publishing_components/lib/cookie-functions.js Also includes: - make new cookie functions handle notify domains - addition of hasConsentFor function to allow easy checking of consent for categories of cookie
16 lines
361 B
JavaScript
16 lines
361 B
JavaScript
(function (window) {
|
|
"use strict";
|
|
|
|
function hasConsentFor (cookieCategory) {
|
|
const consentCookie = window.GOVUK.getConsentCookie();
|
|
|
|
if (consentCookie === null) { return false; }
|
|
|
|
if (!(cookieCategory in consentCookie)) { return false; }
|
|
|
|
return consentCookie[cookieCategory];
|
|
}
|
|
|
|
window.GOVUK.hasConsentFor = hasConsentFor;
|
|
})(window);
|