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 = [
6060${ Object . values ( hints )
6161 . map ( ( hint ) => {
6262 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 } ") }`
6464 } )
6565 . join ( ',\n' ) }
6666];
6767for (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) {
6970 cookieChanged = true;
70- document.cookie = encodeURIComponent(hint.name) + '=' + encodeURIComponent(hint.actual) + '; Max-Age=31536000; path=/';
7171 }
7272}
7373// 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