mirror of
https://github.com/Yubico/yubioath-flutter.git
synced 2024-12-23 18:22:39 +03:00
Listen for cahnges to data instead of node to handle NFC correctly.
This commit is contained in:
parent
60ee8c2f1e
commit
c091bb5c18
@ -21,7 +21,7 @@ class MainPage extends ConsumerWidget {
|
||||
},
|
||||
);
|
||||
// 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) {
|
||||
return route.isFirst ||
|
||||
[
|
||||
|
@ -94,7 +94,7 @@ class AccountDialog extends ConsumerWidget with AccountMixin {
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
// 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.
|
||||
// This will never be shown, as the dialog will be immediately closed
|
||||
return const SizedBox();
|
||||
|
Loading…
Reference in New Issue
Block a user