Skip to content

Commit

Permalink
chore: merge required and slow
Browse files Browse the repository at this point in the history
  • Loading branch information
Tuditi committed May 15, 2024
1 parent 4890f1e commit dde9e7f
Showing 1 changed file with 4 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,16 @@
$: items = setItems(gasPrices, selectedGasSpeed)
function setItems(gasPrices: IGasPricesBySpeed, selectedGasSpeed: GasSpeed): IMenuItem[] {
const gasPriceSlow = gasPrices.required > (gasPrices.slow ?? 0) ? gasPrices.required : gasPrices.slow
const _items = [
{
icon: IconName.ClockPlus,
title: localize('general.required'),
subtitle: formatGasFee(gasUnit, gasPrices.required),
selected: selectedGasSpeed === GasSpeed.Required,
onClick: () => onChooseGasPriceClick(GasSpeed.Required),
},
]
if (gasPrices.slow) {
_items.push({
icon: IconName.ClockPlus,
title: localize('general.slow'),
subtitle: formatGasFee(gasUnit, gasPrices.slow),
subtitle: formatGasFee(gasUnit, gasPriceSlow),
selected: selectedGasSpeed === GasSpeed.Slow,
onClick: () => onChooseGasPriceClick(GasSpeed.Slow),
})
}
},
]
if (gasPrices.average) {
_items.push({
Expand Down

0 comments on commit dde9e7f

Please sign in to comment.