π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
[mob][photos] Fix ML consent logic
laurenspriem602e820442e5
diff --git a/mobile/lib/ui/settings/ml/machine_learning_settings_page.dart b/mobile/lib/ui/settings/ml/machine_learning_settings_page.dartindex 707c9b67fd..6604a7ef59 100644--- a/mobile/lib/ui/settings/ml/machine_learning_settings_page.dart+++ b/mobile/lib/ui/settings/ml/machine_learning_settings_page.dart@@ -214,16 +214,7 @@ class _MachineLearningSettingsPageStateFuture<void> toggleMlConsent() async {final oldMlConsent = userRemoteFlagService.getCachedBoolValue(UserRemoteFlagService.mlEnabled);- final mlConsent = !oldMlConsent;- await userRemoteFlagService.setBoolValue(- UserRemoteFlagService.mlEnabled,- mlConsent,- );- if (!mlConsent) {- MLService.instance.pauseIndexingAndClustering();- unawaited(- MLIndexingIsolate.instance.cleanupLocalIndexingModels(),- );+ if (!oldMlConsent) { // Go to consent page first if not enabledfinal result = await Navigator.push(context,MaterialPageRoute(@@ -235,6 +226,17 @@ class _MachineLearningSettingsPageStateif (result == null || result == false) {return;}+ }+ final mlConsent = !oldMlConsent;+ await userRemoteFlagService.setBoolValue(+ UserRemoteFlagService.mlEnabled,+ mlConsent,+ );+ if (!mlConsent) {+ MLService.instance.pauseIndexingAndClustering();+ unawaited(+ MLIndexingIsolate.instance.cleanupLocalIndexingModels(),+ );} else {await MLService.instance.init();await SemanticSearchService.instance.init();