mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
hit Aquarius only when config is present (#258)
* hit Aquarius only when config is present * more checks
This commit is contained in:
parent
7f2a5e7515
commit
225613745c
@ -67,7 +67,7 @@ export default function Bookmarks(): ReactElement {
|
||||
const [isLoading, setIsLoading] = useState<boolean>()
|
||||
|
||||
useEffect(() => {
|
||||
if (!config || bookmarks === {}) return
|
||||
if (!config?.metadataCacheUri || bookmarks === {}) return
|
||||
|
||||
const networkName = (config as ConfigHelperConfig).network
|
||||
|
||||
|
@ -203,7 +203,13 @@ export default function Pool({ ddo }: { ddo: DDO }): ReactElement {
|
||||
|
||||
// Get graph history data
|
||||
useEffect(() => {
|
||||
if (!price?.address || !price?.ocean || !price?.value) return
|
||||
if (
|
||||
!price?.address ||
|
||||
!price?.ocean ||
|
||||
!price?.value ||
|
||||
!config?.metadataCacheUri
|
||||
)
|
||||
return
|
||||
|
||||
const source = axios.CancelToken.source()
|
||||
const url = `${config.metadataCacheUri}/api/v1/aquarius/pools/history/${price.address}`
|
||||
|
@ -67,7 +67,7 @@ export default function PoolShares(): ReactElement {
|
||||
|
||||
useEffect(() => {
|
||||
async function getAssets() {
|
||||
if (!ocean || !accountId) return
|
||||
if (!ocean || !accountId || !config?.metadataCacheUri) return
|
||||
setIsLoading(true)
|
||||
|
||||
try {
|
||||
|
@ -112,6 +112,8 @@ export default function HomePage(): ReactElement {
|
||||
const [loading, setLoading] = useState(true)
|
||||
|
||||
useEffect(() => {
|
||||
if (!config?.metadataCacheUri) return
|
||||
|
||||
// TODO: remove any once ocean.js has nativeSearch typings
|
||||
async function init() {
|
||||
const queryResultHighest = await getAssets(
|
||||
|
@ -22,6 +22,8 @@ export default function PageTemplateAssetDetails({
|
||||
const [ddo, setDdo] = useState<DDO>()
|
||||
|
||||
useEffect(() => {
|
||||
if (!config?.metadataCacheUri) return
|
||||
|
||||
async function init() {
|
||||
if (ddo) return
|
||||
|
||||
|
@ -20,6 +20,8 @@ export default function SearchPage({
|
||||
const [loading, setLoading] = useState<boolean>()
|
||||
|
||||
useEffect(() => {
|
||||
if (!config?.metadataCacheUri) return
|
||||
|
||||
async function initSearch() {
|
||||
setLoading(true)
|
||||
const queryResult = await getResults(parsed, config.metadataCacheUri)
|
||||
|
Loading…
Reference in New Issue
Block a user