From 5637d906f9c60352c4a98ffa3b2e34a2ae7f5dff Mon Sep 17 00:00:00 2001 From: Adam Velebil Date: Fri, 13 Sep 2024 14:16:53 +0200 Subject: [PATCH] fix code style --- lib/app/views/reset_dialog.dart | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/lib/app/views/reset_dialog.dart b/lib/app/views/reset_dialog.dart index b651fa3f..06c68cb6 100644 --- a/lib/app/views/reset_dialog.dart +++ b/lib/app/views/reset_dialog.dart @@ -124,10 +124,11 @@ class _ResetDialogState extends ConsumerState { !ref.watch(rpcStateProvider.select((state) => state.isAdmin)); // show the progress widgets on desktop, or on Android when using USB - final showFidoResetProgress = !Platform.isAndroid || - (Platform.isAndroid && - (ref.read(currentDeviceProvider)?.transport == Transport.usb || - _currentStep == _totalSteps)); + final showResetProgress = _resetting && + (!Platform.isAndroid || + (Platform.isAndroid && + (ref.read(currentDeviceProvider)?.transport == Transport.usb || + _currentStep == _totalSteps))); return ResponsiveDialog( title: Text(l10n.s_factory_reset), @@ -328,13 +329,11 @@ class _ResetDialogState extends ConsumerState { }, ), ], - if (_resetting) - if (_application == Capability.fido2 && - _currentStep >= 0 && - showFidoResetProgress) ...[ + if (showResetProgress) + if (_application == Capability.fido2 && _currentStep >= 0) ...[ Text('${l10n.s_status}: ${_getMessage()}'), LinearProgressIndicator(value: progress), - ] else if (showFidoResetProgress) + ] else const LinearProgressIndicator() ] .map((e) => Padding(