Fix confusion in AppSettings::load()

This commit is contained in:
2025-11-11 14:36:49 +01:00
parent 64d0541dc6
commit f19e8950e8
2 changed files with 8 additions and 18 deletions

View File

@@ -30,6 +30,10 @@ install-release: java gen
flutter run --release -d 35221JEHN07157
release: java gen
@echo ""
@echo "(!) Make sure you've updated version-number in pubspec.yaml !"
@echo 'Confirmed' && read
@echo ""
flutter build apk --release
cp build/app/outputs/flutter-apk/app-release.apk "_releases/v$(VERS).apk"
@echo ""

View File

@@ -83,7 +83,7 @@ class AppSettings extends ChangeNotifier {
dateFormat = AppSettingsDateFormat.ISO;
messagePreviewLength = 3;
showInfoAlerts = true;
showExtendedAttributes = true;
showExtendedAttributes = false;
notification0 = AppNotificationSettings();
notification1 = AppNotificationSettings();
@@ -102,7 +102,7 @@ class AppSettings extends ChangeNotifier {
dateFormat = AppSettingsDateFormat.parse(Globals().sharedPrefs.getString('settings.dateFormat')) ?? dateFormat;
messagePreviewLength = Globals().sharedPrefs.getInt('settings.messagePreviewLength') ?? messagePreviewLength;
showInfoAlerts = Globals().sharedPrefs.getBool('settings.showInfoAlerts') ?? showInfoAlerts;
showInfoAlerts = Globals().sharedPrefs.getBool('settings.showExtendedAttributes') ?? showExtendedAttributes;
showExtendedAttributes = Globals().sharedPrefs.getBool('settings.showExtendedAttributes') ?? showExtendedAttributes;
notification0 = AppNotificationSettings.load(Globals().sharedPrefs, 'settings.notification0');
notification1 = AppNotificationSettings.load(Globals().sharedPrefs, 'settings.notification1');
@@ -160,14 +160,7 @@ class AppSettings extends ChangeNotifier {
class AppNotificationSettings {
// Immutable
AppNotificationSettings({
this.enableLights = false,
this.enableVibration = true,
this.playSound = true,
this.sound = null,
this.silent = false,
this.timeoutAfter = null,
});
AppNotificationSettings({this.enableLights = false, this.enableVibration = true, this.playSound = true, this.sound = null, this.silent = false, this.timeoutAfter = null});
final bool enableLights;
final bool enableVibration;
@@ -206,14 +199,7 @@ class AppNotificationSettings {
final silent = prefs.getBool('${prefix}.silent') ?? def.silent;
final timeoutAfter = _decode(prefs.getString('${prefix}.timeoutAfter'), def.timeoutAfter);
return AppNotificationSettings(
enableLights: enableLights,
enableVibration: enableVibration,
playSound: playSound,
sound: sound,
silent: silent,
timeoutAfter: timeoutAfter,
);
return AppNotificationSettings(enableLights: enableLights, enableVibration: enableVibration, playSound: playSound, sound: sound, silent: silent, timeoutAfter: timeoutAfter);
}
}