Skip to content

Commit

Permalink
Merge pull request #109 from terraswap/fix/v2/empty-screen
Browse files Browse the repository at this point in the history
fix: stop drawing screen while getting gas from undefined fee
  • Loading branch information
jhlee-young authored Jun 2, 2022
2 parents d2ec565 + 0a7cd43 commit 8700b9d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/forms/SwapForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -825,8 +825,8 @@ const SwapForm = ({ type, tabs }: { type: Type; tabs: TabViewProps }) => {
])
useEffect(() => {
setValue(Key.gasPrice, gasPrice || "")
setValue(Key.feeValue, gasPrice ? ceil(times(fee.gas, gasPrice)) : "")
}, [fee.gas, gasPrice, setValue])
setValue(Key.feeValue, gasPrice ? ceil(times(fee?.gas, gasPrice)) : "")
}, [fee?.gas, gasPrice, setValue])

useEffect(() => {
setValue(Key.feeValue, ceil(times(fee?.gas, gasPrice)) || "")
Expand Down Expand Up @@ -866,8 +866,8 @@ const SwapForm = ({ type, tabs }: { type: Type; tabs: TabViewProps }) => {
: "0",
token: from,
beliefPrice: `${decimal(
div(value1, value2),
18
div(value1, value2),
18
)}`,
})
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/rest/useGasPrice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ import { useNetwork } from "hooks"
export default (symbol: string) => {
const network = useNetwork()

return { gasPrice: network.fee.gasPrice }
return { gasPrice: network.fee?.gasPrice }
}

0 comments on commit 8700b9d

Please sign in to comment.