Skip to content

Commit

Permalink
Release - fuul error handling (#520)
Browse files Browse the repository at this point in the history
* Fix fuul crashing the app

* lint cleanup
  • Loading branch information
pi0neerpat authored May 22, 2024
1 parent 3718c5a commit a425222
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 29 deletions.
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
script-src 'self' blob: http://cdn.matomo.cloud/usekeyp.matomo.cloud/matomo.js https://cdn.matomo.cloud/usekeyp.matomo.cloud/matomo.js https://cdn.matomo.cloud/matomo.js https://usekeyp.matomo.cloud/matomo.js;
media-src 'self';
img-src 'self' data: blob: https://explorer-api.walletconnect.com https://usekeyp.matomo.cloud https://app.opendollar.com;
connect-src 'self' blob: https://api.fuul.xyz https://api.camelot.exchange https://opt-mainnet.g.alchemy.com https://arb-mainnet.g.alchemy.com https://mainnet.optimism.io/ https://holy-damp-firefly.arbitrum-mainnet.quiknode.pro https://api.studio.thegraph.com https://od-subgraph-node-image.onrender.com https://usekeyp.matomo.cloud https://o1016103.ingest.us.sentry.io/api/4507153379295232/envelope/?sentry_key=4784183d694ca39fe99ee2cef64c61fb https://o1016103.ingest.us.sentry.io/api/4507153379295232/security/?sentry_key=4784183d694ca39fe99ee2cef64c61fb https://arbitrum-sepolia.infura.io https://arbitrum-sepolia.blockpi.network/v1/rpc/public https://arbitrum.blockpi.network/v1/rpc/public https://optimism.blockpi.network wss://relay.walletconnect.com/ https://verify.walletconnect.org wss://www.walletlink.org/rpc https://explorer-api.walletconnect.com https://chain-proxy.wallet.coinbase.com https://rpc.walletconnect.com https://bot.opendollar.com https://bot.dev.opendollar.com https://subgraph.reflexer.finance/subgraphs/name/reflexer-labs/rai https://api.country.is/ ;
connect-src 'self' blob: https://api.fuul.xyz https://api.camelot.exchange https://opt-mainnet.g.alchemy.com https://arb-mainnet.g.alchemy.com https://mainnet.optimism.io/ https://holy-damp-firefly.arbitrum-mainnet.quiknode.pro https://api.studio.thegraph.com https://od-subgraph-node-image.onrender.com https://usekeyp.matomo.cloud https://o1016103.ingest.us.sentry.io/api/4507153379295232/envelope/ https://o1016103.ingest.us.sentry.io/api/4507153379295232/security/ https://arbitrum-sepolia.infura.io https://arbitrum-sepolia.blockpi.network/v1/rpc/public https://arbitrum.blockpi.network/v1/rpc/public https://optimism.blockpi.network wss://relay.walletconnect.com/ https://verify.walletconnect.org wss://www.walletlink.org/rpc https://explorer-api.walletconnect.com https://chain-proxy.wallet.coinbase.com https://rpc.walletconnect.com https://bot.opendollar.com https://bot.dev.opendollar.com https://subgraph.reflexer.finance/subgraphs/name/reflexer-labs/rai https://api.country.is/ ;
object-src 'self' blob:;
form-action 'self';
font-src 'self' data: https://fonts.gstatic.com;
Expand Down
14 changes: 7 additions & 7 deletions public/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,26 @@
"name": "Open Dollar",
"icons": [
{
"src": "od-logo256w.webp",
"src": "od-logo256w.png",
"sizes": "256x256",
"type": "image/webp"
"type": "image/png"
},
{
"src": "od-logo192w.webp",
"type": "image/webp",
"src": "od-logo192w.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "od-logo.webp",
"type": "image/webp",
"src": "od-logo.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff",
"iconPath": "od-logo.webp",
"iconPath": "od-logo.png",
"description": "Open Dollar is a stablecoin protocol built on Arbitrum designed to help you yield and leverage your assets with safety and predictability.",
"providedBy": {
"name": "Open Dollar",
Expand Down
10 changes: 7 additions & 3 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,13 @@ Sentry.init({
environment: process.env.NODE_ENV,
})

Fuul.init({
apiKey: process.env.REACT_APP_FUUL_API_KEY!,
})
try {
Fuul.init({
apiKey: process.env.REACT_APP_FUUL_API_KEY!,
})
} catch (e) {
console.log(e)
}

const App = () => {
const location = useLocation()
Expand Down
25 changes: 7 additions & 18 deletions src/components/VaultStats.tsx
Original file line number Diff line number Diff line change
@@ -1,29 +1,18 @@
import { useEffect, useMemo, useState } from 'react'
import { useTranslation } from 'react-i18next'
import styled from 'styled-components'
import { ExternalLink, Info } from 'react-feather'
import { Info } from 'react-feather'
import Numeral from 'numeral'

import { useTokenBalanceInUSD, useSafeInfo } from '~/hooks'
import {
formatNumber,
formatWithCommas,
getEtherscanLink,
getRatePercentage,
ratioChecker,
returnState,
returnTotalDebt,
returnWalletAddress,
} from '~/utils'
import { formatNumber, formatWithCommas, getRatePercentage, ratioChecker, returnState, returnTotalDebt } from '~/utils'
import { useStoreState } from '~/store'
import { Tooltip as ReactTooltip } from 'react-tooltip'
//@ts-ignore
import { generateSvg } from '@opendollar/svg-generator'
import { useWeb3React } from '@web3-react/core'

const VaultStats = ({ isModifying, isDeposit }: { isModifying: boolean; isDeposit: boolean; isOwner: boolean }) => {
const { t } = useTranslation()
const { chainId, account } = useWeb3React()
const {
collateralRatio: newCollateralRatio,
parsedAmounts,
Expand Down Expand Up @@ -373,11 +362,11 @@ const StatValue = styled.div`
margin-top: 5px;
`

const AccountLink = styled.a`
display: flex;
gap: 5px;
color: ${(props) => props.theme.colors.primary};
`
// const AccountLink = styled.a`
// display: flex;
// gap: 5px;
// color: ${(props) => props.theme.colors.primary};
// `

const SVGContainer = styled.div`
display: flex;
Expand Down

0 comments on commit a425222

Please sign in to comment.