Disable "save" when current password is empty.

This commit is contained in:
Dain Nilsson 2021-12-08 14:15:46 +01:00
parent 65560e728d
commit 656addf614
No known key found for this signature in database
GPG Key ID: F04367096FBA95E8

View File

@ -147,7 +147,9 @@ class _ManagePasswordDialogState extends ConsumerState<ManagePasswordDialog> {
child: const Text('Cancel'),
),
TextButton(
onPressed: _newPassword.isNotEmpty && _newPassword == _confirmPassword
onPressed: _newPassword.isNotEmpty &&
_newPassword == _confirmPassword &&
(!hasKey || _currentPassword.isNotEmpty)
? () async {
final result = await ref
.read(oathStateProvider(widget.device.path).notifier)