Merge branch 'master' into iota6_protobuf_models

This commit is contained in:
einhornimmond 2023-09-01 15:27:45 +02:00 committed by GitHub
commit 2a4c68396c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 3 deletions

View File

@ -2,7 +2,7 @@
/* eslint-disable new-cap */
/* eslint-disable @typescript-eslint/no-non-null-assertion */
import { getConnection, In } from '@dbTools/typeorm'
import { getConnection, In, IsNull } from '@dbTools/typeorm'
import { Transaction as dbTransaction } from '@entity/Transaction'
import { TransactionLink as dbTransactionLink } from '@entity/TransactionLink'
import { User as dbUser } from '@entity/User'
@ -264,7 +264,28 @@ export class TransactionResolver {
logger.debug(`transactions=${transactions}`)
// virtual transaction for pending transaction-links sum
if (sumHoldAvailableAmount.greaterThan(0)) {
if (sumHoldAvailableAmount.isZero()) {
const linkCount = await dbTransactionLink.count({
where: {
userId: user.id,
redeemedAt: IsNull(),
},
})
if (linkCount > 0) {
transactions.push(
virtualLinkTransaction(
lastTransaction.balance,
new Decimal(0),
new Decimal(0),
new Decimal(0),
now,
now,
self,
(userTransactions.length && userTransactions[0].balance) || new Decimal(0),
),
)
}
} else if (sumHoldAvailableAmount.greaterThan(0)) {
logger.debug(`sumHoldAvailableAmount > 0: transactions=${transactions}`)
transactions.push(
virtualLinkTransaction(

View File

@ -26,7 +26,7 @@
<div class="mt-3 font-weight-bold">{{ $t('contributionText') }}</div>
<div class="mb-3 text-break word-break">{{ memo }}</div>
<div
v-if="status === 'IN_PROGRESS'"
v-if="status === 'IN_PROGRESS' && !allContribution"
class="text-205 pointer hover-font-bold"
@click="visible = !visible"
>