This commit is contained in:
Dain Nilsson 2022-04-07 13:16:19 +02:00
commit 20ce8c0811
No known key found for this signature in database
GPG Key ID: F04367096FBA95E8
5 changed files with 20 additions and 17 deletions

View File

@ -26,7 +26,7 @@ class AboutPage extends ConsumerWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// TODO: Store the version number elsewhere
const Text('Yubico Authenticator: 6.0.0-alpha.1'),
const Text('Yubico Authenticator: 6.0.0-alpha.2'),
if (isDesktop)
Text('ykman version: ${ref.watch(rpcStateProvider).version}'),
Text('Dart version: ${Platform.version}'),

View File

@ -70,7 +70,7 @@ class FidoLockedPage extends ConsumerWidget {
},
),
MenuAction(
text: 'Delete all data',
text: 'Reset FIDO',
icon: const Icon(Icons.delete_outline),
action: (context) {
showDialog(

View File

@ -29,6 +29,14 @@ class _RenameAccountDialogState extends ConsumerState<RenameFingerprintDialog> {
_label = widget.fingerprint.name ?? '';
}
_submit() async {
final renamed = await ref
.read(fingerprintProvider(widget.devicePath).notifier)
.renameFingerprint(widget.fingerprint, _label);
Navigator.of(context).pop(renamed);
showMessage(context, 'Fingerprint renamed');
}
@override
Widget build(BuildContext context) {
// If current device changes, we need to pop back to the main Page.
@ -36,14 +44,12 @@ class _RenameAccountDialogState extends ConsumerState<RenameFingerprintDialog> {
Navigator.of(context).pop();
});
final fingerprint = widget.fingerprint;
return ResponsiveDialog(
title: const Text('Rename fingerprint'),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('Rename ${fingerprint.label}?'),
Text('Rename ${widget.fingerprint.label}?'),
const Text('This will change the label of the fingerprint.'),
TextFormField(
initialValue: _label,
@ -57,6 +63,11 @@ class _RenameAccountDialogState extends ConsumerState<RenameFingerprintDialog> {
_label = value.trim();
});
},
onFieldSubmitted: (_) {
if (_label.isNotEmpty) {
_submit();
}
},
),
]
.map((e) => Padding(
@ -67,15 +78,7 @@ class _RenameAccountDialogState extends ConsumerState<RenameFingerprintDialog> {
),
actions: [
TextButton(
onPressed: _label.isNotEmpty
? () async {
final renamed = await ref
.read(fingerprintProvider(widget.devicePath).notifier)
.renameFingerprint(fingerprint, _label);
Navigator.of(context).pop(renamed);
showMessage(context, 'Fingerprint renamed');
}
: null,
onPressed: _label.isNotEmpty ? _submit : null,
child: const Text('Save'),
),
],

View File

@ -71,10 +71,10 @@ class AccountDialog extends ConsumerWidget with AccountMixin {
children: [
Text(subtitle ?? ''),
const SizedBox(height: 8.0),
Center(child: buildCodeView(ref, big: true)),
Center(child: FittedBox(child: buildCodeView(ref, big: true))),
],
),
actions: _buildActions(context, ref),
actions: [FittedBox(child: Row(children: _buildActions(context, ref)))],
),
);
}

View File

@ -142,7 +142,7 @@ class _UnlockedView extends ConsumerWidget {
},
),
MenuAction(
text: 'Delete all data',
text: 'Reset OATH',
icon: const Icon(Icons.delete_outline),
action: (context) {
showDialog(