Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: release v1.746.0 #8667

Merged
merged 2 commits into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env.base
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ REACT_APP_FEATURE_PHANTOM_WALLET=true
REACT_APP_FEATURE_THOR_FREE_FEES=true
REACT_APP_FEATURE_LIMIT_ORDERS=true
REACT_APP_FEATURE_NEW_TRADE_FLOW=true
REACT_APP_FEATURE_NEW_WALLET_FLOW=false
REACT_APP_FEATURE_NEW_WALLET_FLOW=true
REACT_APP_FEATURE_FOX_PAGE_FOX_WIF_HAT_SECTION=false

# absolute URL prefix
Expand Down
1 change: 0 additions & 1 deletion .env.dev
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ REACT_APP_FEATURE_FOX_PAGE_FOX_WIF_HAT_SECTION=true

# feature flags
REACT_APP_FEATURE_RFOX_LP=true
REACT_APP_FEATURE_NEW_WALLET_FLOW=true

# logging
REACT_APP_REDUX_WINDOW=false
Expand Down
1 change: 0 additions & 1 deletion .env.develop
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ REACT_APP_FEATURE_FOX_PAGE_FOX_WIF_HAT_SECTION=true

# feature flags
REACT_APP_FEATURE_RFOX_LP=true
REACT_APP_FEATURE_NEW_WALLET_FLOW=true

# mixpanel
REACT_APP_MIXPANEL_TOKEN=1c1369f6ea23a6404bac41b42817cc4b
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,19 @@ export const SellAssetInput = memo(

const handleSellAssetInputChange = useCallback(
(value: string, isFiat: boolean | undefined) => {
const isRateZero = bnOrZero(sellAssetUserCurrencyRate).isZero()

// Avoid division by zero
const sellAmountCryptoPrecision = isFiat
? bnOrZero(value).div(sellAssetUserCurrencyRate).toFixed()
? isRateZero
? '0'
: bnOrZero(value).div(sellAssetUserCurrencyRate).toFixed()
: value

const sellAmountUserCurrency = !isFiat
? bnOrZero(value).times(sellAssetUserCurrencyRate).toFixed()
: value

setRawSellAmountCryptoPrecision(sellAmountCryptoPrecision)
setRawSellAmountUserCurrency(sellAmountUserCurrency)
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ const getBaseReducers = <T extends TradeInputBaseState>(initialState: T) => ({
const { sellAssetUsdRate, buyAssetUsdRate } = action.payload
const sellAmountUsd = bnOrZero(state.sellAmountCryptoPrecision).times(sellAssetUsdRate ?? '0')

state.sellAmountCryptoPrecision = sellAmountUsd.div(buyAssetUsdRate ?? '0').toFixed()
// Avoid division by zero
state.sellAmountCryptoPrecision = bnOrZero(buyAssetUsdRate).isZero()
? '0'
: sellAmountUsd.div(buyAssetUsdRate!).toFixed()

const buyAsset = state.sellAsset
state.sellAsset = state.buyAsset
Expand Down
Loading