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({ return Promise.resolve({
walletScore: walletScore.score, walletScore: walletScore.score,
operatorCompleted: true, 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 })
: _.assign(tx, { : _.assign(tx, {
walletScore: highestScore.score, walletScore: highestScore.score,
error: 'Address score is above defined threshold', error: 'Ciphertrace score is above defined threshold',
errorCode: 'scoreThresholdReached', errorCode: 'scoreThresholdReached',
dispense: true dispense: true
}) })

View file

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

View file

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