Skip to content

Commit

Permalink
don't show progress widgets when using NFC
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamVe committed Sep 13, 2024
1 parent 5a24f57 commit 815150d
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lib/app/views/reset_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ class _ResetDialogState extends ConsumerState<ResetDialog> {
_application == Capability.fido2 &&
!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));

return ResponsiveDialog(
title: Text(l10n.s_factory_reset),
key: factoryResetCancel,
Expand Down Expand Up @@ -323,10 +329,12 @@ class _ResetDialogState extends ConsumerState<ResetDialog> {
),
],
if (_resetting)
if (_application == Capability.fido2 && _currentStep >= 0) ...[
if (_application == Capability.fido2 &&
_currentStep >= 0 &&
showFidoResetProgress) ...[
Text('${l10n.s_status}: ${_getMessage()}'),
LinearProgressIndicator(value: progress),
] else
] else if (showFidoResetProgress)
const LinearProgressIndicator()
]
.map((e) => Padding(
Expand Down

0 comments on commit 815150d

Please sign in to comment.