mirror of
https://github.com/Yubico/yubioath-flutter.git
synced 2024-12-24 18:52:55 +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.
|
// 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 ||
|
||||||
[
|
[
|
||||||
|
@ -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();
|
||||||
|
Loading…
Reference in New Issue
Block a user