Skip to content

Commit

Permalink
Important: fix to make failed hodl invoices clear from pending, fix c…
Browse files Browse the repository at this point in the history
…ontacts (#96)
  • Loading branch information
minibits-cash committed Aug 31, 2024
1 parent d29ee42 commit 87888c3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "minibits_wallet",
"version": "0.1.8-beta.59",
"version": "0.1.8-beta.60",
"private": true,
"scripts": {
"android:clean": "cd android && ./gradlew clean",
Expand Down
2 changes: 1 addition & 1 deletion src/screens/Contacts/PrivateContacts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ export const PrivateContacts = observer(function (props: {
value={newContactName}
autoCapitalize="none"
keyboardType="default"
maxLength={60}
maxLength={64}
selectTextOnFocus={true}
style={[
$contactInput,
Expand Down
8 changes: 4 additions & 4 deletions src/services/walletService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ const _handleSpentByMintTask = async function (

log.trace('[_handleSpentByMintTask]', 'Remaining pendingByMintSecrets', remainingSecrets)

if(pendingCount > 0 && remainingSecrets.length > 0) {
if(remainingSecrets.length > 0) {

log.trace('[_handleSpentByMintTask]', 'Starting sweep of pendingByMintSecrets back to spendable wallet')

Expand All @@ -462,9 +462,9 @@ const _handleSpentByMintTask = async function (

// only move if it is from current mint
if(proofToMove && proofToMove.mintUrl === mintUrl) {
const stillPendingByMint = pendingProofs.find(p => p.secret === secret)
const isStillPendingByMint = pendingProofs.some(p => p.secret === secret)

if(!stillPendingByMint) {
if(!isStillPendingByMint) {
// move to spendable if it is not pending by mint anymore
proofsStore.removeFromPendingByMint(proofToMove as Proof)
movedProofs.push(proofToMove)
Expand All @@ -476,7 +476,7 @@ const _handleSpentByMintTask = async function (
movedToSpendableAmount = CashuUtils.getProofsAmount(movedProofs as Proof[])

if(movedProofs.length > 0) {
log.trace('[_handleSpentByMintTask]', 'Moving proofs from pending to spendable', movedProofs.length)
log.debug('[_handleSpentByMintTask]', 'Moving proofs from pendingByMint to spendable', movedProofs.length)

// Update related transactions as reverted
let relatedTransactionIds: number[] = []
Expand Down

0 comments on commit 87888c3

Please sign in to comment.