From e21fb7525c5b340150d18aeeb1bf1e91f7b5520a Mon Sep 17 00:00:00 2001 From: Elias Bonnici Date: Wed, 10 Apr 2024 12:56:50 +0200 Subject: [PATCH] Set current section to Home on Factory Reset cancel --- lib/app/views/reset_dialog.dart | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/app/views/reset_dialog.dart b/lib/app/views/reset_dialog.dart index 5ebbbbce..9d1233de 100644 --- a/lib/app/views/reset_dialog.dart +++ b/lib/app/views/reset_dialog.dart @@ -130,9 +130,16 @@ class _ResetDialogState extends ConsumerState { ? () { _currentStep = -1; _subscription?.cancel(); + if (isAndroid) { + _resetSection(); + } + } + : null, + _ => isAndroid && _application != null + ? () { + _resetSection(); } : null, - _ => null, }, actions: [ if (_currentStep < _totalSteps) @@ -311,4 +318,8 @@ class _ResetDialogState extends ConsumerState { ), ); } + + void _resetSection() { + ref.read(currentSectionProvider.notifier).setCurrentSection(Section.home); + } }