π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
[mobile][photos] fix notification options switch logic
Priyanshu Dangare0ecae3cfe57f
diff --git a/mobile/apps/photos/lib/ui/settings/notification_settings_screen.dart b/mobile/apps/photos/lib/ui/settings/notification_settings_screen.dartindex 5d129e64b7..6f0e896ef0 100644--- a/mobile/apps/photos/lib/ui/settings/notification_settings_screen.dart+++ b/mobile/apps/photos/lib/ui/settings/notification_settings_screen.dart@@ -32,16 +32,26 @@ class _NotificationSettingsScreenStatebool Function() getValue,Future<void> Function(bool value) setValue,) async {- final value = _hasPermission ? !getValue() : true;+ final oldValue = _hasPermission && getValue();- if (!_hasPermission &&- (!await NotificationService.instance.requestPermissions(context) ||- !mounted)) {+ if (_hasPermission) {+ await setValue(!oldValue);+ if (mounted) setState(() {});+ return;+ }++ final granted = await NotificationService.instance.requestPermissions(+ context,+ );++ if (!granted) {+ await setValue(false);+ if (mounted) setState(() {});return;}_hasPermission = true;- await setValue(value);+ await setValue(true);if (mounted) setState(() {});}