refactor: Store and fix missing persistence of some values

This commit is contained in:
krille-chan 2023-11-01 18:00:10 +01:00
commit c9c2620ad4
No known key found for this signature in database
12 changed files with 120 additions and 165 deletions

View file

@ -30,13 +30,13 @@ class SettingsStyleController extends State<SettingsStyle> {
if (pickedFile == null) return;
await Matrix.of(context)
.store
.setItem(SettingKeys.wallpaper, pickedFile.path);
.setString(SettingKeys.wallpaper, pickedFile.path!);
setState(() {});
}
void deleteWallpaperAction() async {
Matrix.of(context).wallpaper = null;
await Matrix.of(context).store.deleteItem(SettingKeys.wallpaper);
await Matrix.of(context).store.remove(SettingKeys.wallpaper);
setState(() {});
}
@ -76,7 +76,7 @@ class SettingsStyleController extends State<SettingsStyle> {
void changeFontSizeFactor(double d) {
setState(() => AppConfig.fontSizeFactor = d);
Matrix.of(context).store.setItem(
Matrix.of(context).store.setString(
SettingKeys.fontSizeFactor,
AppConfig.fontSizeFactor.toString(),
);