Skip to content

Commit 7daa697

Browse files
authored
Merge pull request #5807 from EdgeApp/jon/fix/ramps-default-amount
`RampCreateScene` not auto-populating a $500 buy amount
2 parents 2edb554 + 97e2250 commit 7daa697

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/components/scenes/RampCreateScene.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,12 +246,12 @@ export const RampCreateScene: React.FC<Props> = (props: Props) => {
246246
if (fiatUsdRate == null) return
247247
let abort = false
248248
const applyInitial = async (): Promise<void> => {
249-
if (abort) return
249+
if (abort || direction !== 'buy') return
250250
// Don't override if the user has started typing or fiat input is disabled
251251
if (
252252
hasAppliedInitialAmount.current ||
253253
amountTypeSupport.onlyCrypto ||
254-
'empty' in exchangeAmount ||
254+
!('empty' in exchangeAmount) ||
255255
lastUsedInput != null ||
256256
shouldShowRegionSelect
257257
) {
@@ -287,7 +287,8 @@ export const RampCreateScene: React.FC<Props> = (props: Props) => {
287287
selectedFiatCurrencyCode,
288288
shouldShowRegionSelect,
289289
fiatUsdRate,
290-
exchangeAmount
290+
exchangeAmount,
291+
direction
291292
])
292293

293294
// Create rampQuoteRequest based on current form state

0 commit comments

Comments
 (0)