save and restore UI language together with other prefs - fixes #443

This commit is contained in:
dakkar 2024-03-03 11:23:30 +00:00
parent 2e55108b6b
commit ebe8179c9e

View file

@ -139,6 +139,7 @@ type Profile = {
hot: Record<keyof typeof defaultStoreSaveKeys, unknown>;
cold: Record<keyof typeof coldDeviceStorageSaveKeys, unknown>;
fontSize: string | null;
lang: string | null;
cornerRadius: string | null;
useSystemFont: 't' | null;
wallpaper: string | null;
@ -197,6 +198,7 @@ function getSettings(): Profile['settings'] {
hot,
cold,
fontSize: miLocalStorage.getItem('fontSize'),
lang: miLocalStorage.getItem('lang'),
cornerRadius: miLocalStorage.getItem('cornerRadius'),
useSystemFont: miLocalStorage.getItem('useSystemFont') as 't' | null,
wallpaper: miLocalStorage.getItem('wallpaper'),
@ -312,6 +314,13 @@ async function applyProfile(id: string): Promise<void> {
miLocalStorage.removeItem('fontSize');
}
// lang
if (settings.lang) {
miLocalStorage.setItem('lang', settings.lang);
} else {
miLocalStorage.removeItem('lang');
}
// cornerRadius
if (settings.cornerRadius) {
miLocalStorage.setItem('cornerRadius', settings.cornerRadius);