Skip to content

Commit

Permalink
Merge pull request #297 from cashubtc/fix-later-button-receive-ecash
Browse files Browse the repository at this point in the history
Fix "Later" button functionality in receive ecash dialog
  • Loading branch information
callebtc authored Dec 24, 2024
2 parents f6882c7 + d2e2590 commit f3b20b0
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/components/ReceiveTokenDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -392,14 +392,16 @@ export default defineComponent({
undefined
);
},
addPendingTokenToHistory: function (token) {
if (this.tokenAlreadyInHistory(token)) {
addPendingTokenToHistory: function (tokenStr) {
if (this.tokenAlreadyInHistory(tokenStr)) {
this.notifySuccess("Ecash already in history");
this.showReceiveTokens = false;
return;
}
const tokensStore = useTokensStore();
const decodedToken = tokensStore.decodeToken(token);
const decodedToken = this.decodeToken(tokenStr);
const mintInToken = this.getMint(decodedToken);
const unitInToken = token.getUnit(decodedToken);
// get amount from decodedToken.token.proofs[..].amount
const amount = this.getProofs(decodedToken).reduce(
(sum, el) => (sum += el.amount),
Expand All @@ -408,7 +410,9 @@ export default defineComponent({
tokensStore.addPendingToken({
amount: amount,
token: token,
token: tokenStr,
mintInToken: mintInToken,
unitInToken: unitInToken,
});
this.showReceiveTokens = false;
// show success notification
Expand Down

0 comments on commit f3b20b0

Please sign in to comment.