Skip to content

Commit

Permalink
[mob][photos] Don't keep showing the banner
Browse files Browse the repository at this point in the history
  • Loading branch information
laurenspriem committed Nov 15, 2024
1 parent 8a7e11e commit 0f3e490
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mobile/lib/ui/home/status_bar_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class _StatusBarWidgetState extends State<StatusBarWidget> {
late StreamSubscription<NotificationEvent> _notificationSubscription;
bool _showStatus = false;
bool _showErrorBanner = false;
final bool _showMlBanner = !userRemoteFlagService
bool _showMlBanner = !userRemoteFlagService
.getCachedBoolValue(UserRemoteFlagService.mlEnabled) &&
!localSettings.hasSeenMLEnablingBanner;
Error? _syncError;
Expand Down Expand Up @@ -75,6 +75,9 @@ class _StatusBarWidgetState extends State<StatusBarWidget> {
_notificationSubscription =
Bus.instance.on<NotificationEvent>().listen((event) {
if (mounted) {
_showMlBanner = !userRemoteFlagService
.getCachedBoolValue(UserRemoteFlagService.mlEnabled) &&
!localSettings.hasSeenMLEnablingBanner;
setState(() {});
}
});
Expand Down
1 change: 1 addition & 0 deletions mobile/lib/ui/settings/ml/enable_ml_consent.dart
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ class _EnableMachineLearningConsentState
UserRemoteFlagService.mlEnabled,
true,
);
Bus.instance.fire(NotificationEvent());
Navigator.of(context).pop(true);
} catch (e) {
// ignore: unawaited_futures
Expand Down

0 comments on commit 0f3e490

Please sign in to comment.