mirror of
https://github.com/wukko/cobalt.git
synced 2025-04-30 14:34:27 +02:00
web/lib/settings: add accessibility section, add dontAutoOpenQueue
moved `reduceMotion`, `reduceTransparency`, and `disableHaptics` to accessibility, migrated first two from old version of settings
This commit is contained in:
parent
1137ccfd3b
commit
1f0abf5169
@ -11,9 +11,12 @@ const defaultSettings: CobaltSettings = {
|
|||||||
theme: "auto",
|
theme: "auto",
|
||||||
language: defaultLocale,
|
language: defaultLocale,
|
||||||
autoLanguage: true,
|
autoLanguage: true,
|
||||||
|
},
|
||||||
|
accessibility: {
|
||||||
reduceMotion: false,
|
reduceMotion: false,
|
||||||
reduceTransparency: false,
|
reduceTransparency: false,
|
||||||
disableHaptics: false,
|
disableHaptics: false,
|
||||||
|
dontAutoOpenQueue: false,
|
||||||
},
|
},
|
||||||
save: {
|
save: {
|
||||||
alwaysProxy: false,
|
alwaysProxy: false,
|
||||||
|
@ -64,6 +64,17 @@ const migrations: Record<number, Migrator> = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (settings?.appearance) {
|
||||||
|
if ("reduceMotion" in settings.appearance) {
|
||||||
|
out.accessibility!.reduceMotion = settings.appearance.reduceMotion;
|
||||||
|
delete settings.appearance.reduceMotion;
|
||||||
|
}
|
||||||
|
if ("reduceTransparency" in settings.appearance) {
|
||||||
|
out.accessibility!.reduceTransparency = settings.appearance.reduceTransparency;
|
||||||
|
delete settings.appearance.reduceTransparency;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return out as AllPartialSettingsWithSchema;
|
return out as AllPartialSettingsWithSchema;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -2,8 +2,12 @@ import { type CobaltSettingsV4 } from "$lib/types/settings/v4";
|
|||||||
|
|
||||||
export type CobaltSettingsV5 = Omit<CobaltSettingsV4, 'schemaVersion' | 'advanced' | 'save' | 'privacy' | 'appearance'> & {
|
export type CobaltSettingsV5 = Omit<CobaltSettingsV4, 'schemaVersion' | 'advanced' | 'save' | 'privacy' | 'appearance'> & {
|
||||||
schemaVersion: 5,
|
schemaVersion: 5,
|
||||||
appearance: CobaltSettingsV4['appearance'] & {
|
appearance: Omit<CobaltSettingsV4['appearance'], 'reduceMotion' | 'reduceTransparency'>,
|
||||||
|
accessibility: {
|
||||||
|
reduceMotion: boolean;
|
||||||
|
reduceTransparency: boolean;
|
||||||
disableHaptics: boolean;
|
disableHaptics: boolean;
|
||||||
|
dontAutoOpenQueue: boolean;
|
||||||
},
|
},
|
||||||
advanced: CobaltSettingsV4['advanced'] & {
|
advanced: CobaltSettingsV4['advanced'] & {
|
||||||
useWebCodecs: boolean;
|
useWebCodecs: boolean;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user