File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -60,14 +60,14 @@ const hints = [
60
60
${ Object . values ( hints )
61
61
. map ( ( hint ) => {
62
62
const cookieName = JSON . stringify ( hint . cookieName )
63
- return `{ name: ${ cookieName } , actual: String(${ hint . getValueCode } ), cookie : cookies[${ cookieName } ] }`
63
+ return `{ name: ${ cookieName } , actual: String(${ hint . getValueCode } ), value : cookies[${ cookieName } ] ?? encodeURIComponent(" ${ hint . fallback } ") }`
64
64
} )
65
65
. join ( ',\n' ) }
66
66
];
67
67
for (const hint of hints) {
68
- if (decodeURIComponent(hint.cookie) !== hint.actual) {
68
+ document.cookie = encodeURIComponent(hint.name) + '=' + encodeURIComponent(hint.actual) + '; Max-Age=31536000; path=/';
69
+ if (decodeURIComponent(hint.value) !== hint.actual) {
69
70
cookieChanged = true;
70
- document.cookie = encodeURIComponent(hint.name) + '=' + encodeURIComponent(hint.actual) + '; Max-Age=31536000; path=/';
71
71
}
72
72
}
73
73
// if the cookie changed, reload the page, unless the browser doesn't support
You can’t perform that action at this time.
0 commit comments