Skip to content

Commit

Permalink
Make secure bitcoin wallet receive default to Bitcoin network
Browse files Browse the repository at this point in the history
  • Loading branch information
i5hi committed May 2, 2024
1 parent 2892ed1 commit c7fd568
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"ios": true,
//
//
"**/pubspec.yaml": true,
// "**/pubspec.yaml": true,
//
//
"**/test": true,
Expand Down
2 changes: 1 addition & 1 deletion lib/locator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
21 changes: 14 additions & 7 deletions lib/receive/receive_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,23 @@ class _ReceivePageState extends State<ReceivePage> {
walletsStorageRepository: locator<WalletsStorageRepository>(),
);

_receiveCubit.updateWalletType(
ReceivePaymentNetwork.lightning,
context.read<NetworkCubit>().state.testnet,
onStart: true,
);

final network = context.read<NetworkCubit>().state.getBBNetwork();
final walletBloc = widget.walletBloc ??
context.read<HomeCubit>().state.getMainInstantWallet(network);
if (walletBloc == null) return;

if (walletBloc!.state.wallet!.isLiquid()) {
_receiveCubit.updateWalletType(
ReceivePaymentNetwork.lightning,
context.read<NetworkCubit>().state.testnet,
onStart: true,
);
} else {
_receiveCubit.updateWalletType(
ReceivePaymentNetwork.bitcoin,
context.read<NetworkCubit>().state.testnet,
onStart: true,
);
}

_receiveCubit.updateWalletBloc(walletBloc);

Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down

0 comments on commit c7fd568

Please sign in to comment.