mirror of
https://github.com/minibits-cash/minibits_wallet.git
synced 2026-08-11 08:59:18 +00:00
Fix: Long running tasks cause crash if notification channel is not created.
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "minibits_wallet",
|
||||
"version": "0.2.0-beta.7",
|
||||
"version": "0.2.0-beta.8",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"android:clean": "cd android && ./gradlew clean",
|
||||
|
||||
@@ -40,7 +40,11 @@ export const sendTask = async function (
|
||||
const mintUrl = mintBalanceToSendFrom.mintUrl
|
||||
|
||||
log.trace('[sendTask]', 'mintBalanceToSendFrom', mintBalanceToSendFrom)
|
||||
log.trace('[sendTask]', 'amountToSend', {amountToSend, unit})
|
||||
log.trace('[sendTask]', 'amountToSend', {amountToSend, unit})
|
||||
|
||||
if(amountToSend <= 0) {
|
||||
throw new AppError(Err.VALIDATION_ERROR, 'Amount to send must be above zero.')
|
||||
}
|
||||
|
||||
// create draft transaction
|
||||
const transactionData: TransactionData[] = [
|
||||
|
||||
@@ -420,6 +420,11 @@ const swapAllTask = async function (): Promise<WalletTaskResult> {
|
||||
|
||||
for (const unit of mint.units) {
|
||||
const proofsToOptimize = proofsStore.getByMint(mint.mintUrl, { isPending: false, unit, ascending: true })
|
||||
|
||||
if(proofsToOptimize.length === 0) {
|
||||
continue
|
||||
}
|
||||
|
||||
initialProofsCount += proofsToOptimize.length
|
||||
const mintBalance = mint.balances
|
||||
|
||||
@@ -459,7 +464,8 @@ const swapAllTask = async function (): Promise<WalletTaskResult> {
|
||||
}
|
||||
} else {
|
||||
// If the length is less than or equal to limit, run with all proofs.
|
||||
const proofsAmount = CashuUtils.getProofsAmount(proofsToOptimize)
|
||||
const proofsAmount = CashuUtils.getProofsAmount(proofsToOptimize)
|
||||
|
||||
const sendResult = await sendTask(
|
||||
mintBalance!,
|
||||
proofsAmount,
|
||||
|
||||
Reference in New Issue
Block a user