mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
remove fileInfo check, cleanup (#689)
Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro>
This commit is contained in:
parent
e02babf2c2
commit
04d505da42
@ -11,7 +11,7 @@ import Trade from './Trade'
|
|||||||
import { useAsset } from '../../../providers/Asset'
|
import { useAsset } from '../../../providers/Asset'
|
||||||
import { useOcean } from '../../../providers/Ocean'
|
import { useOcean } from '../../../providers/Ocean'
|
||||||
import { useWeb3 } from '../../../providers/Web3'
|
import { useWeb3 } from '../../../providers/Web3'
|
||||||
import { getFileInfo } from '../../../utils/provider'
|
import { fileinfo, getFileInfo } from '../../../utils/provider'
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
|
|
||||||
export default function AssetActions(): ReactElement {
|
export default function AssetActions(): ReactElement {
|
||||||
@ -26,24 +26,27 @@ export default function AssetActions(): ReactElement {
|
|||||||
const isCompute = Boolean(ddo?.findServiceByType('compute'))
|
const isCompute = Boolean(ddo?.findServiceByType('compute'))
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!config) return
|
const { attributes } = ddo.findServiceByType('metadata')
|
||||||
const source = axios.CancelToken.source()
|
setFileMetadata(attributes.main.files[0])
|
||||||
async function initFileInfo() {
|
// !!!!! do not remove this, we will enable this again after fileInfo endpoint is fixed !!!
|
||||||
setFileIsLoading(true)
|
// if (!config) return
|
||||||
try {
|
// const source = axios.CancelToken.source()
|
||||||
const fileInfo = await getFileInfo(
|
// async function initFileInfo() {
|
||||||
DID.parse(`${ddo.id}`),
|
// setFileIsLoading(true)
|
||||||
config.providerUri,
|
// try {
|
||||||
source.token
|
// const fileInfo = await getFileInfo(
|
||||||
)
|
// DID.parse(`${ddo.id}`),
|
||||||
setFileMetadata(fileInfo.data[0])
|
// config.providerUri,
|
||||||
} catch (error) {
|
// source.token
|
||||||
Logger.error(error.message)
|
// )
|
||||||
} finally {
|
// setFileMetadata(fileInfo.data[0])
|
||||||
setFileIsLoading(false)
|
// } catch (error) {
|
||||||
}
|
// Logger.error(error.message)
|
||||||
}
|
// } finally {
|
||||||
initFileInfo()
|
// setFileIsLoading(false)
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// initFileInfo()
|
||||||
}, [config, ddo.id])
|
}, [config, ddo.id])
|
||||||
|
|
||||||
// Get and set user DT balance
|
// Get and set user DT balance
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
const cleanupContentType = (contentType: string): string => {
|
const cleanupContentType = (contentType: string): string => {
|
||||||
|
// strip away the `charset=utf-8`
|
||||||
|
const contentSplit = contentType.split(';')[0]
|
||||||
// strip away the 'application/' part
|
// strip away the 'application/' part
|
||||||
const contentTypeSplit = contentType.split('/')[1]
|
const contentTypeSplit = contentSplit.split('/')[1]
|
||||||
|
|
||||||
if (!contentTypeSplit) return contentType
|
if (!contentTypeSplit) return contentType
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user