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>()
|
const [isLoading, setIsLoading] = useState<boolean>()
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!config || bookmarks === {}) return
|
if (!config?.metadataCacheUri || bookmarks === {}) return
|
||||||
|
|
||||||
const networkName = (config as ConfigHelperConfig).network
|
const networkName = (config as ConfigHelperConfig).network
|
||||||
|
|
||||||
|
@ -203,7 +203,13 @@ export default function Pool({ ddo }: { ddo: DDO }): ReactElement {
|
|||||||
|
|
||||||
// Get graph history data
|
// Get graph history data
|
||||||
useEffect(() => {
|
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 source = axios.CancelToken.source()
|
||||||
const url = `${config.metadataCacheUri}/api/v1/aquarius/pools/history/${price.address}`
|
const url = `${config.metadataCacheUri}/api/v1/aquarius/pools/history/${price.address}`
|
||||||
|
@ -67,7 +67,7 @@ export default function PoolShares(): ReactElement {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
async function getAssets() {
|
async function getAssets() {
|
||||||
if (!ocean || !accountId) return
|
if (!ocean || !accountId || !config?.metadataCacheUri) return
|
||||||
setIsLoading(true)
|
setIsLoading(true)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -112,6 +112,8 @@ export default function HomePage(): ReactElement {
|
|||||||
const [loading, setLoading] = useState(true)
|
const [loading, setLoading] = useState(true)
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
if (!config?.metadataCacheUri) return
|
||||||
|
|
||||||
// TODO: remove any once ocean.js has nativeSearch typings
|
// TODO: remove any once ocean.js has nativeSearch typings
|
||||||
async function init() {
|
async function init() {
|
||||||
const queryResultHighest = await getAssets(
|
const queryResultHighest = await getAssets(
|
||||||
|
@ -22,6 +22,8 @@ export default function PageTemplateAssetDetails({
|
|||||||
const [ddo, setDdo] = useState<DDO>()
|
const [ddo, setDdo] = useState<DDO>()
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
if (!config?.metadataCacheUri) return
|
||||||
|
|
||||||
async function init() {
|
async function init() {
|
||||||
if (ddo) return
|
if (ddo) return
|
||||||
|
|
||||||
|
@ -20,6 +20,8 @@ export default function SearchPage({
|
|||||||
const [loading, setLoading] = useState<boolean>()
|
const [loading, setLoading] = useState<boolean>()
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
if (!config?.metadataCacheUri) return
|
||||||
|
|
||||||
async function initSearch() {
|
async function initSearch() {
|
||||||
setLoading(true)
|
setLoading(true)
|
||||||
const queryResult = await getResults(parsed, config.metadataCacheUri)
|
const queryResult = await getResults(parsed, config.metadataCacheUri)
|
||||||
|
Loading…
Reference in New Issue
Block a user