Merge branch 'master' into feerate-tooltip-usually

This commit is contained in:
Felipe Knorr Kuhn
2022-06-28 06:17:12 -07:00
committed by GitHub
3 changed files with 18 additions and 8 deletions

View File

@@ -140,9 +140,8 @@ export default class TxView implements TransactionStripped {
}
getColor(): Color {
let feeLevelIndex = feeLevels.slice().reverse().findIndex((feeLvl) => (this.feerate || 1) >= feeLvl);
feeLevelIndex = feeLevelIndex >= 0 ? feeLevels.length - feeLevelIndex : feeLevelIndex;
return hexToColor(mempoolFeeColors[feeLevelIndex - 1] || mempoolFeeColors[mempoolFeeColors.length - 1]);
const feeLevelIndex = feeLevels.findIndex((feeLvl) => Math.max(1, this.feerate) < feeLvl) - 1;
return hexToColor(mempoolFeeColors[feeLevelIndex] || mempoolFeeColors[mempoolFeeColors.length - 1]);
}
}