mirror of
https://github.com/Yubico/yubioath-flutter.git
synced 2024-11-22 08:22:16 +03:00
preserve connections in addToAny methods
This commit is contained in:
parent
827c95f72b
commit
90cd67ac65
@ -36,6 +36,7 @@ import '../../exception/platform_exception_decoder.dart';
|
|||||||
import '../../oath/models.dart';
|
import '../../oath/models.dart';
|
||||||
import '../../oath/state.dart';
|
import '../../oath/state.dart';
|
||||||
import '../../widgets/toast.dart';
|
import '../../widgets/toast.dart';
|
||||||
|
import '../app_methods.dart';
|
||||||
import '../overlay/nfc/method_channel_notifier.dart';
|
import '../overlay/nfc/method_channel_notifier.dart';
|
||||||
import '../overlay/nfc/nfc_overlay.dart';
|
import '../overlay/nfc/nfc_overlay.dart';
|
||||||
|
|
||||||
@ -194,6 +195,7 @@ final addCredentialToAnyProvider =
|
|||||||
Provider((ref) => (Uri credentialUri, {bool requireTouch = false}) async {
|
Provider((ref) => (Uri credentialUri, {bool requireTouch = false}) async {
|
||||||
final oath = ref.watch(_oathMethodsProvider.notifier);
|
final oath = ref.watch(_oathMethodsProvider.notifier);
|
||||||
try {
|
try {
|
||||||
|
await preserveConnectedDeviceWhenPaused();
|
||||||
var result = jsonDecode(await oath.invoke('addAccountToAny', {
|
var result = jsonDecode(await oath.invoke('addAccountToAny', {
|
||||||
'uri': credentialUri.toString(),
|
'uri': credentialUri.toString(),
|
||||||
'requireTouch': requireTouch
|
'requireTouch': requireTouch
|
||||||
@ -209,6 +211,7 @@ final addCredentialsToAnyProvider = Provider(
|
|||||||
(ref) => (List<String> credentialUris, List<bool> touchRequired) async {
|
(ref) => (List<String> credentialUris, List<bool> touchRequired) async {
|
||||||
final oath = ref.read(_oathMethodsProvider.notifier);
|
final oath = ref.read(_oathMethodsProvider.notifier);
|
||||||
try {
|
try {
|
||||||
|
await preserveConnectedDeviceWhenPaused();
|
||||||
_log.debug(
|
_log.debug(
|
||||||
'Calling android with ${credentialUris.length} credentials to be added');
|
'Calling android with ${credentialUris.length} credentials to be added');
|
||||||
var result = jsonDecode(await oath.invoke('addAccountsToAny',
|
var result = jsonDecode(await oath.invoke('addAccountsToAny',
|
||||||
|
Loading…
Reference in New Issue
Block a user