Skip to content

Commit

Permalink
fix: wrong amount displayed if user changes original value
Browse files Browse the repository at this point in the history
  • Loading branch information
wainola committed May 14, 2024
1 parent 28e1ee2 commit 3780105
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/widget/src/controllers/transfers/substrate/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,14 @@ export async function buildSubstrateFungibleTransactions(
String(this.resourceAmount)
);

console.log('substrate transfer', transfer);

this.fee = await substrateTransfer.getFee(transfer);

this.resourceAmount = this.resourceAmount.sub(this.fee.fee.toString());
if (this.resourceAmount.toString() === transfer.details.amount.toString()) {
this.resourceAmount = this.resourceAmount.sub(this.fee.fee.toString());
}

this.pendingTransferTransaction = substrateTransfer.buildTransferTransaction(
transfer,
this.fee
Expand Down

0 comments on commit 3780105

Please sign in to comment.