Skip to content

Comments

feat: Automatically trigger initialisation if cookiePolicy script is ran after DOM content has loaded#182

Merged
petesfrench merged 2 commits intomainfrom
wd-17648
Dec 11, 2024
Merged

feat: Automatically trigger initialisation if cookiePolicy script is ran after DOM content has loaded#182
petesfrench merged 2 commits intomainfrom
wd-17648

Conversation

@petesfrench
Copy link
Contributor

@petesfrench petesfrench commented Dec 10, 2024

Done

  • Adds a fallback to automatically trigger the init function if the cookiePolicy script is called after DOM content has loaded. I also as added a check with in the init function to see if it has already ran to avoid it being ran twice.

QA

  • Check out this branch
  • Build the project with npm run build
  • Run the project with npm run server
  • Visit the website at http://0.0.0.0:8301/
  • Revoke the cookies
  • Check that the cookie-policy modal opens
  • Defer the cookie-policy script from running until after DOM content has loaded (you can do this by adding the defer attribute to the script tag)

@nbellol
Copy link
Collaborator

nbellol commented Dec 10, 2024

LGTM! Tested both cases and everything worked correctly.

Copy link
Collaborator

@nbellol nbellol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@petesfrench petesfrench merged commit 4612bce into main Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants