Skip to content

Commit

Permalink
ensure cookie bar is not shown if everything was accepted
Browse files Browse the repository at this point in the history
  • Loading branch information
sergei-maertens committed Aug 6, 2023
1 parent 9900342 commit 68e1f25
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cookie_consent/static/cookie_consent/cookiebar.module.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,9 @@ export const showCookieBar = async (options={}) => {
: (cookieBarNode) => doInsertBefore(insertBefore, cookieBarNode)
;
await loadCookieStatus();
// there are no (more) cookie groups to accept, don't show the bar
if (!COOKIE_STATUS.cookieGroups.length) return;

// grab the contents from the template node and add them to the DOM, optionally
// calling the onShow callback
const cookieBarNode = templateNode.content.firstElementChild.cloneNode(true);
Expand Down

0 comments on commit 68e1f25

Please sign in to comment.