Skip to content

Commit

Permalink
send fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mocodesmo committed Jan 5, 2025
1 parent 5d0c4ba commit d018d34
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 10 deletions.
11 changes: 10 additions & 1 deletion lib/_repository/network_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -226,12 +226,21 @@ class NetworkRepository {
}

double get pickLiquidFees {
if (testnet) {
switch (_data.value.selectedLiquidNetwork) {
case LiquidElectrumTypes.custom:
case LiquidElectrumTypes.blockstream:
return 0.1;
case LiquidElectrumTypes.bullbitcoin:
return 0.1;
}
}
switch (_data.value.selectedLiquidNetwork) {
case LiquidElectrumTypes.custom:
case LiquidElectrumTypes.blockstream:
return 0.1;
case LiquidElectrumTypes.bullbitcoin:
return 0.01; // 0.01; TODO: Sai for liquid testnet
return 0.01;
}
}

Expand Down
1 change: 0 additions & 1 deletion lib/_repository/wallet_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,6 @@ class WalletService {
updateTypes: [
UpdateWalletTypes.transactions,
UpdateWalletTypes.addresses,
UpdateWalletTypes.transactions,
UpdateWalletTypes.utxos,
],
);
Expand Down
3 changes: 2 additions & 1 deletion lib/_ui/app_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ class BBAppBar extends StatelessWidget {
).animate(delay: 100.ms).fadeIn(),
),
],
const Spacer(),
// const Spacer(),
const Gap(16),
Padding(
padding: const EdgeInsets.only(bottom: 8),
child: BBText.titleLarge(
Expand Down
5 changes: 4 additions & 1 deletion lib/home/transactions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,10 @@ class HomeTxItem2 extends StatelessWidget {
// final showOnlySwap = tx.pageLayout == TxLayout.onlySwapTx;
// if (showOnlySwap) return _SwapTxHomeListItem(transaction: tx);

final label = tx.label ?? '';
final label = (tx.label != null && tx.label!.length > 20)
? '${tx.label!.substring(0, 20)}...'
: tx.label ?? '';

final isReceive = tx.isReceived();

final amount = context.select(
Expand Down
1 change: 1 addition & 0 deletions lib/network_fees/bloc/networkfees_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ class NetworkFeesCubit extends Cubit<NetworkFeesState> {
Future loadFees() async {
emit(state.copyWith(loadingFees: true, errLoadingFees: ''));
final testnet = _networkRepository.testnet;
await Future.delayed(const Duration(milliseconds: 50));

final (fees, err) = await _mempoolAPI.getFees(testnet);
if (err != null) {
Expand Down
6 changes: 5 additions & 1 deletion lib/send/bloc/send_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1082,7 +1082,11 @@ class SendCubit extends Cubit<SendState> {
return feeAmt ?? 0;
}

Future<void> processSendButton(String label, int feeRate, int amt) async {
Future<void> processSendButton({
required String label,
required int feeRate,
required int amt,
}) async {
final network = _networkRepository.getBBNetwork;
final (_, addressError) =
await state.getPaymentNetwork(state.address, network);
Expand Down
6 changes: 3 additions & 3 deletions lib/send/send_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -633,9 +633,9 @@ class _SendButton extends StatelessWidget {
.state
.selectedOrFirst(true);
context.read<SendCubit>().processSendButton(
txLabel,
amt,
feeRate,
label: txLabel,
feeRate: feeRate,
amt: amt,
);
},
label: buttonLabel,
Expand Down
4 changes: 3 additions & 1 deletion lib/transaction/transaction_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,11 @@ class _TxAppBar extends StatelessWidget {

@override
Widget build(BuildContext context) {
final label =
var label =
context.select((TransactionCubit cubit) => cubit.state.tx.label ?? '');

label = (label.length > 20) ? '${label.substring(0, 20)}...' : label;

return BBAppBar(
text: label.isNotEmpty ? label : 'Transaction',
onBack: () {
Expand Down
5 changes: 4 additions & 1 deletion lib/wallet/wallet_txs.dart
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,10 @@ class HomeTxItem extends StatelessWidget {

@override
Widget build(BuildContext context) {
final label = tx.label ?? '';
// final label = tx.label ?? '';
final label = (tx.label != null && tx.label!.length > 20)
? '${tx.label!.substring(0, 20)}...'
: tx.label ?? '';
final isReceive = tx.isReceived();

var amount = context.select(
Expand Down

0 comments on commit d018d34

Please sign in to comment.