fix(settings): persist false-y values

This commit is contained in:
Paul 2021-12-26 15:03:44 +00:00
parent 301070a3cb
commit bb707fb287
2 changed files with 3 additions and 2 deletions

View file

@ -75,7 +75,8 @@ export default class Settings
@action hydrate(data: ISettings) {
Object.keys(data).forEach(
(key) =>
(data as any)[key] && this.data.set(key, (data as any)[key]),
typeof (data as any)[key] !== "undefined" &&
this.data.set(key, (data as any)[key]),
);
}

View file

@ -51,7 +51,7 @@ export default observer(() => {
!state.settings.get("appearance:seasonal"),
);
const seasonalTheme = state.settings.get("appearance:seasonal") ?? true;
const seasonalTheme = state.settings.get("appearance:seasonal", true);
const isDecember = !isTouchscreenDevice && new Date().getMonth() === 11;
const snowflakes = useMemo(() => {
const flakes = [];