Skip to content
Snippets Groups Projects
Commit dfd940da authored by Ewen Le Bihan's avatar Ewen Le Bihan
Browse files

feat(noel): force noel theme as default (c'est la dictature ici d'accord?)

parent 33882ea4
Branches
Tags v1.34.0
No related merge requests found
......@@ -8,8 +8,13 @@ export const theme = writable('system', (set) => {
// It's not possible to load the theme on the server
if (!browser) return;
// Force Noël theme if not re-set to sth else by the user
if (localStorage.getItem('user_does_not_like_noel_theme') === null) {
set('noel');
} else {
// Try to load the theme from sessionStorage or fallback to a media query
set(localStorage.getItem('theme') ?? 'system');
}
});
export const isDark = writable(false);
......
......@@ -28,6 +28,7 @@
import InputText from '$lib/components/InputText.svelte';
import ButtonGhost from '$lib/components/ButtonGhost.svelte';
import FormNotificationSettings from '$lib/components/FormNotificationSettings.svelte';
import { browser } from '$app/environment';
let godparentRequestSendServerError = '';
let godparentRequestSending = false;
......@@ -248,6 +249,11 @@
noel: 'Noël',
}}
bind:value={$theme}
on:input={() => {
if (browser)
window.localStorage.setItem('user_does_not_like_noel_theme', '');
}}
/>
{/if}
<h2>Parrainages</h2>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment