fix Add account when cam permission not granted

This commit is contained in:
Adam Velebil 2023-03-03 17:17:29 +01:00
parent 96781f7140
commit 7261d2de63
No known key found for this signature in database
GPG Key ID: C9B1E4A3CBBD2E10
3 changed files with 6 additions and 2 deletions

View File

@ -31,6 +31,7 @@ class AndroidQrScanner implements QrScanner {
(context) async => await Navigator.of(context).push(PageRouteBuilder(
pageBuilder: (_, __, ___) =>
Theme(data: AppTheme.darkTheme, child: const QrScannerView()),
settings: const RouteSettings(name: 'android_qr_scanner_view'),
transitionDuration: const Duration(seconds: 0),
reverseTransitionDuration: const Duration(seconds: 0),
)));

View File

@ -63,6 +63,7 @@ class MainPage extends ConsumerWidget {
'user_interaction_prompt',
'oath_add_account',
'oath_icon_pack_dialog',
'android_qr_scanner_view',
].contains(route.settings.name);
});
});

View File

@ -57,6 +57,8 @@ Widget oathBuildActions(
enabled: used != null && (capacity == null || capacity > used),
onTap: used != null && (capacity == null || capacity > used)
? () async {
final credentials = ref.read(credentialsProvider);
final withContext = ref.read(withContextProvider);
Navigator.of(context).pop();
CredentialData? otpauth;
if (Platform.isAndroid) {
@ -73,13 +75,13 @@ Widget oathBuildActions(
}
}
}
await ref.read(withContextProvider)((context) async {
await withContext((context) async {
await showBlurDialog(
context: context,
builder: (context) => OathAddAccountPage(
devicePath,
oathState,
credentials: ref.watch(credentialsProvider),
credentials: credentials,
credentialData: otpauth,
),
);