fix: correctly return cookie value in banner-dismiss.js#55716
Conversation
|
Welcome @Nithin0620! |
ebcdc0a to
c01bb0a
Compare
✅ Pull request preview available for checkingBuilt without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Thanks! /lgtm |
|
LGTM label has been added. DetailsGit tree hash: c0294bc4b233cd7d904aed6ae93588f70c9a6164 |
lmktfy
left a comment
There was a problem hiding this comment.
/label tide/merge-method-squash
/approve
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: lmktfy The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Description
This PR fixes the
getCookie()function inassets/js/banner-dismiss.js.Previously, the function returned
"true"whenever the cookie existed, regardless of the cookie's actual stored value. This caused incorrect behavior for any logic depending on the real cookie value.The fix updates
getCookie()to return the decoded cookie value usingdecodeURIComponent(matches[1]).Additionally, the redundant check:
has been simplified to a truthy check after fixing
getCookie():This makes the logic cleaner, more reliable, and future-proof.
Changes Made
getCookie()to return the actual cookie value."true"return behavior.