Skip to content

Commit

Permalink
Change error name
Browse files Browse the repository at this point in the history
  • Loading branch information
chasefleming committed Feb 27, 2024
1 parent c41da49 commit 56772d9
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions components/FundAccountSubmitted.tsx
Expand Up @@ -36,7 +36,7 @@ export default function FundAccountSubmitted({
}) {
const [isFetchingBalance, setIsFetchingBalance] = useState(false)
const [balance, setBalance] = useState("")
const [error, setError] = useState("")
const [balanceError, setBalanceError] = useState("")

useEffect(() => {
if (typeof result === "undefined") return
Expand Down Expand Up @@ -101,9 +101,9 @@ access(all) fun main(account: Address): UFix64 {
setBalance("--")

if (error instanceof Error) {
setError(error.message)
setBalanceError(error.message)
} else {
setError("An unknown error occurred")
setBalanceError("An unknown error occurred")
}
} finally {
setIsFetchingBalance(false)
Expand Down Expand Up @@ -163,7 +163,9 @@ access(all) fun main(account: Address): UFix64 {
) : (
<>
<div>{balance}</div>
{error && error.length > 0 && <div>{error}</div>}
{balanceError && balanceError.length > 0 && (
<div>{balanceError}</div>
)}
</>
)}
</>
Expand Down

0 comments on commit 56772d9

Please sign in to comment.