fix: expire theme cookie in 1 year

This commit is contained in:
Andy O'Neill committed 2023-05-31 19:12:54 -04:00
1 parent aaab5d62ad
commit 44eb5781cd
1 file changed
+3 -2
+3 -2
View File
@@ -31,11 +31,12 @@ const persistTheme = theme => {
if (systemPreferencesTheme() === theme) {
// Clear the cookie to represent using the system preferences
document.cookie = `${COOKIE_KEY}=`;
document.cookie = `${COOKIE_KEY}=;path=/`;
return;
}
document.cookie = `${COOKIE_KEY}=${theme}`;
const expires = new Date(new Date().setYear(new Date().getFullYear() + 1)).toUTCString();
document.cookie = `${COOKIE_KEY}=${theme};expires=${expires};path=/`;
};
export {