diff --git a/ui/component/viewers/appViewer/view.jsx b/ui/component/viewers/appViewer/view.jsx index 9ed779999..3b8709760 100644 --- a/ui/component/viewers/appViewer/view.jsx +++ b/ui/component/viewers/appViewer/view.jsx @@ -1,6 +1,7 @@ // @flow -import React, { useState, useEffect } from 'react'; -import LoadingScreen from 'component/common/loading-screen'; +import React from 'react'; +import Yrbl from 'component/yrbl'; +// import LoadingScreen from 'component/common/loading-screen'; type Props = { source: string, @@ -8,57 +9,66 @@ type Props = { contentType: string, }; -const SANDBOX_TYPES = ['application/x-lbry', 'application/x-ext-lbry']; +// const SANDBOX_TYPES = ['application/x-lbry', 'application/x-ext-lbry']; // This server exists in src/platforms/electron/startSandBox.js -const SANDBOX_SET_BASE_URL = 'http://localhost:5278/set/'; -const SANDBOX_CONTENT_BASE_URL = 'http://localhost:5278'; +// const SANDBOX_SET_BASE_URL = 'http://localhost:5278/set/'; +// const SANDBOX_CONTENT_BASE_URL = 'http://localhost:5278'; function AppViewer(props: Props) { - const { claim, contentType } = props; - const [loading, setLoading] = useState(true); - const [appUrl, setAppUrl] = useState(false); + // const { claim, contentType } = props; + // const [loading, setLoading] = useState(true); + // const [appUrl, setAppUrl] = useState(false); - const outpoint = `${claim.txid}:${claim.nout}`; - useEffect(() => { - if (SANDBOX_TYPES.indexOf(contentType) > -1) { - fetch(`${SANDBOX_SET_BASE_URL}${outpoint}`) - .then(res => res.text()) - .then(url => { - const appUrl = `${SANDBOX_CONTENT_BASE_URL}${url}`; - setAppUrl(appUrl); - setLoading(false); - }) - .catch(err => { - setLoading(false); - }); - } else { - setLoading(false); - } - }, [outpoint, contentType, setAppUrl, setLoading]); + // const outpoint = `${claim.txid}:${claim.nout}`; + // useEffect(() => { + // if (SANDBOX_TYPES.indexOf(contentType) > -1) { + // fetch(`${SANDBOX_SET_BASE_URL}${outpoint}`) + // .then(res => res.text()) + // .then(url => { + // const appUrl = `${SANDBOX_CONTENT_BASE_URL}${url}`; + // setAppUrl(appUrl); + // setLoading(false); + // }) + // .catch(err => { + // setLoading(false); + // }); + // } else { + // setLoading(false); + // } + // }, [outpoint, contentType, setAppUrl, setLoading]); return ( -
- {!appUrl && ( - - )} - {appUrl && ( - - )} +
+
); + + // return ( + //
+ // {!appUrl && ( + // + // )} + // {appUrl && ( + // + // )} + //
+ // ); } export default AppViewer;