fix: ciphertrace ui score color

This commit is contained in:
José Oliveira 2022-08-23 15:27:09 +01:00 committed by josepfo
parent c003cc81f8
commit 209ead5e32
4 changed files with 11 additions and 5 deletions

View file

@ -113,7 +113,8 @@ function postProcess (r, pi, isBlacklisted, addressReuse, walletScore) {
return Promise.resolve({
walletScore: walletScore.score,
operatorCompleted: true,
error: 'Ciphertrace score is above defined threshold'
error: 'Ciphertrace score is above defined threshold',
errorCode: 'scoreThresholdReached'
})
}

View file

@ -134,7 +134,7 @@ function getWalletScore (tx, pi) {
? _.assign(tx, { walletScore: highestScore.score })
: _.assign(tx, {
walletScore: highestScore.score,
error: 'Address score is above defined threshold',
error: 'Ciphertrace score is above defined threshold',
errorCode: 'scoreThresholdReached',
dispense: true
})

View file

@ -169,6 +169,10 @@ const DetailsRow = ({ it: tx, timezone }) => {
FileSaver.saveAs(content, zipFilename)
}
const hasCiphertraceError = tx =>
!R.isNil(tx.errorCode) &&
R.includes(tx.errorCode, ['scoreThresholdReached', 'ciphertraceError'])
const errorElements = (
<>
<Label>Transaction status</Label>
@ -187,10 +191,10 @@ const DetailsRow = ({ it: tx, timezone }) => {
r={3.5}
fill={
it < tx.walletScore
? R.isNil(tx.hasError)
? !hasCiphertraceError(tx)
? primaryColor
: errorColor
: R.isNil(tx.hasError)
: !hasCiphertraceError(tx)
? subheaderColor
: offErrorColor
}
@ -203,7 +207,7 @@ const DetailsRow = ({ it: tx, timezone }) => {
noMargin
className={classNames({
[classes.bold]: true,
[classes.error]: !R.isNil(tx.hasError)
[classes.error]: hasCiphertraceError(tx)
})}>
{tx.walletScore}
</P>

View file

@ -101,6 +101,7 @@ const GET_TRANSACTIONS = gql`
sendConfirmed
dispense
hasError: error
errorCode
deviceId
fiat
cashInFee