Skip to content

Commit ef336c2

Browse files
OdrinEgor Komarov
and
Egor Komarov
authored
fix: add notifyReceiver parameter to token wallet send functionality (#801)
Co-authored-by: Egor Komarov <[email protected]>
1 parent dd40107 commit ef336c2

File tree

4 files changed

+14
-1
lines changed

4 files changed

+14
-1
lines changed

lib/app/router/routs/wallet/wallet.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ const tokenWalletSendDestinationQueryParam = 'tokenWalletSendDestination';
4747
const tokenWalletSendAmountQueryParam = 'tokenWalletSendAmount';
4848
const tokenWalletSendAttachedAmountQueryParam = 'tokenWalletSendAttachedAmount';
4949
const tokenWalletSendResultMessageQueryParam = 'tokenWalletSendResultMessage';
50+
const tokenWalletSendNotifyReceiverQueryParam = 'tokenWalletSendNotifyReceiver';
5051

5152
const walletDeployAddressPathParam = 'walletDeployAddress';
5253
const walletDeployPublicKeyPathParam = 'walletDeployPublicKey';
@@ -314,6 +315,10 @@ GoRoute get tokenWalletSendRoute {
314315
comment: state.uri.queryParameters[tokenWalletSendCommentQueryParam],
315316
resultMessage:
316317
state.uri.queryParameters[tokenWalletSendResultMessageQueryParam],
318+
notifyReceiver: bool.tryParse(
319+
state.uri.queryParameters[tokenWalletSendNotifyReceiverQueryParam] ??
320+
'',
321+
),
317322
);
318323
},
319324
);

lib/feature/wallet/staking/view/staking_page/staking_page_widget.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ class _ButtonWidget extends StatelessWidget {
223223
LocaleKeys.withdrawHoursProgress.tr(
224224
args: [wm.currency.symbol, withdrawHours.toString()],
225225
),
226+
tokenWalletSendNotifyReceiverQueryParam: 'true',
226227
},
227228
),
228229
);

lib/feature/wallet/token_wallet_send/bloc/token_wallet_send_bloc.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class TokenWalletSendBloc
3131
required this.attachedAmount,
3232
required this.comment,
3333
required this.resultMessage,
34+
required this.notifyReceiver,
3435
}) : super(const TokenWalletSendState.init()) {
3536
_registerHandlers();
3637
}
@@ -67,6 +68,8 @@ class TokenWalletSendBloc
6768
/// Message that will be shown when transaction completed
6869
final String resultMessage;
6970

71+
final bool? notifyReceiver;
72+
7073
/// Fee for transaction after calculating it in [_handlePrepare]
7174
BigInt? fees;
7275

@@ -240,7 +243,7 @@ class TokenWalletSendBloc
240243
amount: tokenAmount,
241244
payload: comment,
242245
attachedAmount: attachedAmount,
243-
notifyReceiver: false,
246+
notifyReceiver: notifyReceiver ?? false,
244247
);
245248

246249
final unsignedMessage = await nekotonRepository.prepareTransfer(

lib/feature/wallet/token_wallet_send/view/token_wallet_send_page.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class TokenWalletSendPage extends StatelessWidget {
2222
required this.attachedAmount,
2323
required this.comment,
2424
required this.resultMessage,
25+
required this.notifyReceiver,
2526
super.key,
2627
});
2728

@@ -52,6 +53,8 @@ class TokenWalletSendPage extends StatelessWidget {
5253
/// Message that will be shown when transaction completed
5354
final String? resultMessage;
5455

56+
final bool? notifyReceiver;
57+
5558
@override
5659
Widget build(BuildContext context) {
5760
return BlocProvider<TokenWalletSendBloc>(
@@ -64,6 +67,7 @@ class TokenWalletSendPage extends StatelessWidget {
6467
attachedAmount: attachedAmount,
6568
comment: comment,
6669
publicKey: publicKey,
70+
notifyReceiver: notifyReceiver,
6771
nekotonRepository: inject(),
6872
messengerService: inject(),
6973
resultMessage:

0 commit comments

Comments
 (0)