Skip to content

Commit 318dff6

Browse files
authored
fix(transactions): propagate memo field to service layer (#7413)
# Motivation #7407 activated the memo field for the ICP transaction modal. But the value was not being propagated from the component to the service layer. This PR fixes the issue. # Changes - Propagate the `memo` to the submit event. # Tests - Updated test. # Todos - [x] Accessibility (a11y) – any impact? - [x] Changelog – is it needed?
1 parent 1931cea commit 318dff6

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

frontend/src/lib/components/transaction/TransactionReview.svelte

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
destinationInfo: Snippet;
1919
disableSubmit: boolean;
2020
handleGoBack: () => void;
21-
memo?: string;
2221
receivedAmount: Snippet;
2322
selectedNetwork?: TransactionNetwork;
2423
showLedgerFee?: boolean;
@@ -34,7 +33,6 @@
3433
destinationInfo,
3534
disableSubmit,
3635
handleGoBack,
37-
memo,
3836
receivedAmount,
3937
selectedNetwork = undefined,
4038
showLedgerFee = true,
@@ -44,7 +42,8 @@
4442
withMemo,
4543
}: Props = $props();
4644
47-
const { sourceAccount, amount, destinationAddress } = $derived(transaction);
45+
const { sourceAccount, amount, destinationAddress, memo } =
46+
$derived(transaction);
4847
4948
const dispatcher = createEventDispatcher();
5049
const submit = () => {

frontend/src/lib/modals/transaction/TransactionModal.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@
175175
destinationAddress: selectedDestinationAddress,
176176
sourceAccount,
177177
amount,
178+
memo,
178179
}}
179180
handleGoBack={goBack}
180181
{transactionFee}
@@ -185,7 +186,6 @@
185186
on:nnsSubmit
186187
on:nnsClose
187188
{withMemo}
188-
{memo}
189189
>
190190
{#snippet additionalInfo()}
191191
<slot name="additional-info-review" />

frontend/src/tests/lib/modals/accounts/IcpTransactionModal.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ describe("IcpTransactionModal", () => {
141141
amount: parseInt(icpAmount),
142142
destinationAddress:
143143
"d0654c53339c85e0e5fff46a2d800101bc3d896caef34e1a0597426792ff9f32",
144-
memo: undefined,
144+
memo: "1234",
145145
sourceAccount: mockMainAccount,
146146
})
147147
);

0 commit comments

Comments
 (0)