From c7fd568af2befed07ea9768ec9b730715e14f880 Mon Sep 17 00:00:00 2001 From: i5hi Date: Fri, 3 May 2024 00:29:07 +0530 Subject: [PATCH] Make secure bitcoin wallet receive default to Bitcoin network --- .vscode/settings.json | 2 +- lib/locator.dart | 2 +- lib/receive/receive_page.dart | 21 ++++++++++++++------- pubspec.yaml | 2 +- 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index b8017b93..9b1218f2 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -61,7 +61,7 @@ "ios": true, // // - "**/pubspec.yaml": true, + // "**/pubspec.yaml": true, // // "**/test": true, diff --git a/lib/locator.dart b/lib/locator.dart index b7df08b9..fe0ba19a 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -53,7 +53,7 @@ import 'package:flutter_animate/flutter_animate.dart'; import 'package:get_it/get_it.dart'; import 'package:go_router/go_router.dart'; -const bbVersion = '0.2.0-1'; +const bbVersion = '0.2.0-2'; GetIt locator = GetIt.instance; diff --git a/lib/receive/receive_page.dart b/lib/receive/receive_page.dart index 3c5eb901..ce86688e 100644 --- a/lib/receive/receive_page.dart +++ b/lib/receive/receive_page.dart @@ -69,16 +69,23 @@ class _ReceivePageState extends State { walletsStorageRepository: locator(), ); - _receiveCubit.updateWalletType( - ReceivePaymentNetwork.lightning, - context.read().state.testnet, - onStart: true, - ); - final network = context.read().state.getBBNetwork(); final walletBloc = widget.walletBloc ?? context.read().state.getMainInstantWallet(network); - if (walletBloc == null) return; + + if (walletBloc!.state.wallet!.isLiquid()) { + _receiveCubit.updateWalletType( + ReceivePaymentNetwork.lightning, + context.read().state.testnet, + onStart: true, + ); + } else { + _receiveCubit.updateWalletType( + ReceivePaymentNetwork.bitcoin, + context.read().state.testnet, + onStart: true, + ); + } _receiveCubit.updateWalletBloc(walletBloc); diff --git a/pubspec.yaml b/pubspec.yaml index 318fe38d..24bb2336 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: bb_mobile description: Bull Bitcoin Mobile Wallet publish_to: 'none' -version: 0.2.0-1+14 +version: 0.2.0-2+14 environment: sdk: ">=3.3.0 <4.0.0"