Listen for cahnges to data instead of node to handle NFC correctly.

This commit is contained in:
Dain Nilsson 2022-06-10 16:24:33 +02:00
parent 60ee8c2f1e
commit c091bb5c18
No known key found for this signature in database
GPG Key ID: F04367096FBA95E8
2 changed files with 2 additions and 2 deletions

View File

@ -21,7 +21,7 @@ class MainPage extends ConsumerWidget {
}, },
); );
// If the current device changes, we need to pop any open dialogs. // If the current device changes, we need to pop any open dialogs.
ref.listen<DeviceNode?>(currentDeviceProvider, (_, __) { ref.listen<YubiKeyData?>(currentDeviceDataProvider, (_, __) {
Navigator.of(context).popUntil((route) { Navigator.of(context).popUntil((route) {
return route.isFirst || return route.isFirst ||
[ [

View File

@ -94,7 +94,7 @@ class AccountDialog extends ConsumerWidget with AccountMixin {
@override @override
Widget build(BuildContext context, WidgetRef ref) { Widget build(BuildContext context, WidgetRef ref) {
// TODO: Solve this in a cleaner way // TODO: Solve this in a cleaner way
if (ref.watch(currentDeviceProvider) == null) { if (ref.watch(currentDeviceDataProvider) == null) {
// The rest of this method assumes there is a device, and will throw an exception if not. // The rest of this method assumes there is a device, and will throw an exception if not.
// This will never be shown, as the dialog will be immediately closed // This will never be shown, as the dialog will be immediately closed
return const SizedBox(); return const SizedBox();