Skip to content

Commit

Permalink
preserve connections in addToAny methods
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamVe committed Sep 10, 2024
1 parent 827c95f commit 90cd67a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/android/oath/state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import '../../exception/platform_exception_decoder.dart';
import '../../oath/models.dart';
import '../../oath/state.dart';
import '../../widgets/toast.dart';
import '../app_methods.dart';
import '../overlay/nfc/method_channel_notifier.dart';
import '../overlay/nfc/nfc_overlay.dart';

Expand Down Expand Up @@ -194,6 +195,7 @@ final addCredentialToAnyProvider =
Provider((ref) => (Uri credentialUri, {bool requireTouch = false}) async {
final oath = ref.watch(_oathMethodsProvider.notifier);
try {
await preserveConnectedDeviceWhenPaused();
var result = jsonDecode(await oath.invoke('addAccountToAny', {
'uri': credentialUri.toString(),
'requireTouch': requireTouch
Expand All @@ -209,6 +211,7 @@ final addCredentialsToAnyProvider = Provider(
(ref) => (List<String> credentialUris, List<bool> touchRequired) async {
final oath = ref.read(_oathMethodsProvider.notifier);
try {
await preserveConnectedDeviceWhenPaused();
_log.debug(
'Calling android with ${credentialUris.length} credentials to be added');
var result = jsonDecode(await oath.invoke('addAccountsToAny',
Expand Down

0 comments on commit 90cd67a

Please sign in to comment.