Skip to content

Commit

Permalink
Reset _dataLoaded and options
Browse files Browse the repository at this point in the history
  • Loading branch information
elibon99 committed Jan 16, 2025
1 parent 2472201 commit 74459b4
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions lib/oath/views/add_account_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -334,11 +334,18 @@ class _OathAddAccountPageState extends ConsumerState<OathAddAccountPage>
}
}

void clearFields() {
void clearCredentialData() {
_issuerController.clear();
_accountController.clear();
_secretController.clear();
setState(() {});
setState(() {
_touch = false;
_oathType = defaultOathType;
_hashAlgorithm = defaultHashAlgorithm;
_digits = defaultDigits;
_counter = defaultCounter;
_dataLoaded = false;
});
}

void handleQrData(String? qrData, WithContext withContext) async {
Expand Down Expand Up @@ -444,7 +451,7 @@ class _OathAddAccountPageState extends ConsumerState<OathAddAccountPage>
),
onPressed: () async {
if (_qrScanSuccess) {
clearFields();
clearCredentialData();
setState(() {
_qrScanSuccess = false;
});
Expand Down

0 comments on commit 74459b4

Please sign in to comment.