mirror of
https://github.com/wukko/cobalt.git
synced 2025-04-29 22:14:26 +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",
|
||||
language: defaultLocale,
|
||||
autoLanguage: true,
|
||||
},
|
||||
accessibility: {
|
||||
reduceMotion: false,
|
||||
reduceTransparency: false,
|
||||
disableHaptics: false,
|
||||
dontAutoOpenQueue: false,
|
||||
},
|
||||
save: {
|
||||
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;
|
||||
},
|
||||
};
|
||||
|
@ -2,8 +2,12 @@ import { type CobaltSettingsV4 } from "$lib/types/settings/v4";
|
||||
|
||||
export type CobaltSettingsV5 = Omit<CobaltSettingsV4, 'schemaVersion' | 'advanced' | 'save' | 'privacy' | 'appearance'> & {
|
||||
schemaVersion: 5,
|
||||
appearance: CobaltSettingsV4['appearance'] & {
|
||||
appearance: Omit<CobaltSettingsV4['appearance'], 'reduceMotion' | 'reduceTransparency'>,
|
||||
accessibility: {
|
||||
reduceMotion: boolean;
|
||||
reduceTransparency: boolean;
|
||||
disableHaptics: boolean;
|
||||
dontAutoOpenQueue: boolean;
|
||||
},
|
||||
advanced: CobaltSettingsV4['advanced'] & {
|
||||
useWebCodecs: boolean;
|
||||
|
Loading…
x
Reference in New Issue
Block a user