showNostrConnectQrcode method

void showNostrConnectQrcode(
  1. BuildContext context
)

Implementation

void showNostrConnectQrcode(BuildContext context) async {
  if (nostrConnect == null) return;

  openNostrConnectDialog(context);

  try {
    final bunkerSettings = await ndk.accounts.loginWithNostrConnect(
      nostrConnect: nostrConnect!,
      bunkers: ndk.bunkers,
      // authCallback: (challenge) => showBunkerAuthToast(challenge),
    );

    if (isNostrConnectDialogOpen) {
      Navigator.of(context).pop();
      isNostrConnectDialogOpen = false;
    }

    if (bunkerSettings == null) return;

    await loggedIn();
  } catch (e) {
    if (isNostrConnectDialogOpen) {
      Navigator.of(context).pop();
      isNostrConnectDialogOpen = false;
    }
  }
}