Skip to content

Commit 013a17f

Browse files
refactor: remove unrelated autoswap changes from COP feature branch
1 parent 96d9176 commit 013a17f

4 files changed

Lines changed: 8 additions & 43 deletions

File tree

lib/core/storage/database_seeds.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ class DatabaseSeeds {
7979
const AutoSwapRow(
8080
id: 1,
8181
enabled: true,
82-
balanceThresholdSats: 1000000,
83-
triggerBalanceSats: 2000000,
82+
balanceThresholdSats: 500000,
83+
triggerBalanceSats: 1000000,
8484
feeThresholdPercent: 1.0,
8585
blockTillNextExecution: false,
8686
alwaysBlock: false,
@@ -93,8 +93,8 @@ class DatabaseSeeds {
9393
const AutoSwapRow(
9494
id: 2,
9595
enabled: true,
96-
balanceThresholdSats: 1000000,
97-
triggerBalanceSats: 2000000,
96+
balanceThresholdSats: 500000,
97+
triggerBalanceSats: 1000000,
9898
feeThresholdPercent: 1.0,
9999
blockTillNextExecution: false,
100100
alwaysBlock: false,

lib/features/autoswap/ui/screens/autoswap_settings_screen.dart

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import 'package:bb_mobile/core/widgets/inputs/text_input.dart';
77
import 'package:bb_mobile/core/widgets/switch/bb_switch.dart';
88
import 'package:bb_mobile/core/widgets/text/text.dart';
99
import 'package:bb_mobile/features/autoswap/presentation/autoswap_settings_cubit.dart';
10-
import 'package:bb_mobile/features/wallet/presentation/bloc/wallet_bloc.dart';
1110
import 'package:bb_mobile/locator.dart';
1211
import 'package:flutter/material.dart';
1312
import 'package:flutter_bloc/flutter_bloc.dart';
@@ -23,15 +22,8 @@ class AutoSwapSettingsScreen extends StatelessWidget {
2322
child: Scaffold(
2423
appBar: AppBar(title: Text(context.loc.autoswapSettingsTitle)),
2524
body: SafeArea(
26-
child: BlocListener<AutoSwapSettingsCubit, AutoSwapSettingsState>(
27-
listenWhen: (previous, current) =>
28-
previous.successfullySaved != current.successfullySaved &&
29-
current.successfullySaved,
30-
listener: (context, state) {
31-
context.read<WalletBloc>().add(const WalletRefreshed());
32-
},
33-
child: BlocBuilder<AutoSwapSettingsCubit, AutoSwapSettingsState>(
34-
builder: (context, state) {
25+
child: BlocBuilder<AutoSwapSettingsCubit, AutoSwapSettingsState>(
26+
builder: (context, state) {
3527
final enabled = state.enabledToggle;
3628

3729
return SingleChildScrollView(
@@ -69,7 +61,6 @@ class AutoSwapSettingsScreen extends StatelessWidget {
6961
);
7062
},
7163
),
72-
),
7364
),
7465
),
7566
);

lib/features/autoswap/ui/widgets/autoswap_settings.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import 'package:bb_mobile/core/widgets/inputs/text_input.dart';
99
import 'package:bb_mobile/core/widgets/switch/bb_switch.dart';
1010
import 'package:bb_mobile/core/widgets/text/text.dart';
1111
import 'package:bb_mobile/features/autoswap/presentation/autoswap_settings_cubit.dart';
12-
import 'package:bb_mobile/features/wallet/presentation/bloc/wallet_bloc.dart';
1312
import 'package:bb_mobile/locator.dart';
1413
import 'package:flutter/material.dart';
1514
import 'package:flutter_bloc/flutter_bloc.dart';
@@ -54,7 +53,6 @@ class _AutoSwapSettingsContentState extends State<AutoSwapSettingsContent> {
5453
previous.successfullySaved != current.successfullySaved &&
5554
current.successfullySaved,
5655
listener: (context, state) {
57-
context.read<WalletBloc>().add(const WalletRefreshed());
5856
Navigator.of(context).pop();
5957
},
6058
child: BlocBuilder<AutoSwapSettingsCubit, AutoSwapSettingsState>(

lib/features/wallet/ui/widgets/autoswap_warning_bottom_sheet.dart

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1-
import 'package:bb_mobile/core/settings/domain/settings_entity.dart';
21
import 'package:bb_mobile/core/themes/app_theme.dart';
3-
import 'package:bb_mobile/core/utils/amount_conversions.dart';
4-
import 'package:bb_mobile/core/utils/amount_formatting.dart';
52
import 'package:bb_mobile/core/utils/build_context_x.dart';
63
import 'package:bb_mobile/core/widgets/bottom_sheet/x.dart';
74
import 'package:bb_mobile/core/widgets/buttons/button.dart';
85
import 'package:bb_mobile/core/widgets/text/text.dart';
9-
import 'package:bb_mobile/features/settings/presentation/bloc/settings_cubit.dart';
106
import 'package:bb_mobile/features/settings/ui/settings_router.dart';
117
import 'package:bb_mobile/features/wallet/presentation/bloc/wallet_bloc.dart';
128
import 'package:flutter/material.dart';
@@ -26,26 +22,6 @@ class AutoSwapWarningBottomSheet extends StatelessWidget {
2622

2723
@override
2824
Widget build(BuildContext context) {
29-
final autoSwapSettings = context.select(
30-
(WalletBloc bloc) => bloc.state.autoSwapSettings,
31-
);
32-
33-
final bitcoinUnit = context.select(
34-
(SettingsCubit cubit) => cubit.state.bitcoinUnit ?? BitcoinUnit.btc,
35-
);
36-
37-
final targetBalance = autoSwapSettings != null
38-
? (bitcoinUnit == BitcoinUnit.btc
39-
? FormatAmount.btc(ConvertAmount.satsToBtc(autoSwapSettings.balanceThresholdSats))
40-
: FormatAmount.sats(autoSwapSettings.balanceThresholdSats))
41-
: (bitcoinUnit == BitcoinUnit.btc ? '0.01 BTC' : '1,000,000 sats');
42-
43-
final maxBalance = autoSwapSettings != null
44-
? (bitcoinUnit == BitcoinUnit.btc
45-
? FormatAmount.btc(ConvertAmount.satsToBtc(autoSwapSettings.triggerBalanceSats))
46-
: FormatAmount.sats(autoSwapSettings.triggerBalanceSats))
47-
: (bitcoinUnit == BitcoinUnit.btc ? '0.02 BTC' : '2,000,000 sats');
48-
4925
return Container(
5026
padding: const EdgeInsets.all(24),
5127
decoration: BoxDecoration(
@@ -75,13 +51,13 @@ class AutoSwapWarningBottomSheet extends StatelessWidget {
7551
),
7652
const Gap(8),
7753
BBText(
78-
'Target Balance $targetBalance',
54+
context.loc.autoswapWarningBaseBalance,
7955
style: context.font.bodyMedium,
8056
color: context.appColors.onSurface,
8157
),
8258
const Gap(4),
8359
BBText(
84-
'Maximum Balance of $maxBalance',
60+
context.loc.autoswapWarningTriggerAmount,
8561
style: context.font.bodyMedium,
8662
color: context.appColors.onSurface,
8763
),

0 commit comments

Comments
 (0)