Add new unseen tx screen
This commit is contained in:
parent
9a43bc4417
commit
8b1480589f
1 changed files with 3 additions and 1 deletions
|
|
@ -56,6 +56,7 @@ function fetchPhoneTx (phone) {
|
|||
return db.any(sql, values)
|
||||
.then(_.map(toCashOutTx))
|
||||
.then(txs => {
|
||||
const seenTxs = _.some(it => it.status !== 'notSeen', txs)
|
||||
const confirmedTxs = txs.filter(tx => _.includes(tx.status, ['instant', 'confirmed']))
|
||||
if (confirmedTxs.length > 0) {
|
||||
const reducer = (acc, val) => {
|
||||
|
|
@ -67,7 +68,8 @@ function fetchPhoneTx (phone) {
|
|||
return maxTx
|
||||
}
|
||||
|
||||
if (txs.length > 0) throw httpError('Pending transactions', 412)
|
||||
if (txs.length > 0 && !seenTxs) throw httpError('Transaction not seen', 411)
|
||||
if (txs.length > 0 && seenTxs) throw httpError('Pending transactions', 412)
|
||||
throw httpError('No transactions', 404)
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue