Skip to content

Commit 7d5880f

Browse files
authored
Merge pull request #14946 from TylerAPfledderer/fix/SendReceive-story-prevent-num-updates
fix(SendReceive.stories): stop eth price updates during chromatic snapshots
2 parents 601c3a1 + 139a468 commit 7d5880f

File tree

1 file changed

+3
-1
lines changed
  • src/components/Simulator/screens/SendReceive

1 file changed

+3
-1
lines changed

src/components/Simulator/screens/SendReceive/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React, { useEffect, useMemo, useState } from "react"
2+
import isChromatic from "chromatic"
23

34
import type { PhoneScreenProps } from "@/lib/types"
45

@@ -24,7 +25,8 @@ import { Success } from "./Success"
2425
export const SendReceive = ({ nav, ctaLabel }: PhoneScreenProps) => {
2526
const { progressStepper, step } = nav
2627
const fetchedPrice = useEthPrice()
27-
const ethPrice = fetchedPrice > 1 ? fetchedPrice : FALLBACK_ETH_PRICE
28+
const ethPrice =
29+
fetchedPrice > 1 && !isChromatic() ? fetchedPrice : FALLBACK_ETH_PRICE
2830
const ethReceiveAmount = USD_RECEIVE_AMOUNT / ethPrice
2931
const [chosenAmount, setChosenAmount] = useState(0)
3032
const ethChosenAmount = chosenAmount / ethPrice

0 commit comments

Comments
 (0)