diff --git a/src/components/app-body/balance.js b/src/components/app-body/balance.js index 45d8ede..0a41d41 100644 --- a/src/components/app-body/balance.js +++ b/src/components/app-body/balance.js @@ -45,7 +45,7 @@ function GetBalance (props) {
- Enter a BCH address to check the balance. + Enter any BCH address to query its balance on the blockchain. setTextInput(e.target.value)} /> diff --git a/src/components/app-body/index.js b/src/components/app-body/index.js index 84cf638..13e4837 100644 --- a/src/components/app-body/index.js +++ b/src/components/app-body/index.js @@ -28,7 +28,7 @@ function AppBody (props) { return ( <> - } /> + } />} /> } /> } /> } /> diff --git a/src/components/footer/index.js b/src/components/footer/index.js index bd56a52..a6c7f04 100644 --- a/src/components/footer/index.js +++ b/src/components/footer/index.js @@ -3,25 +3,25 @@ */ // Global npm libraries -import React, { useEffect, useState } from 'react' +import React, { useEffect } from 'react' import { Container, Row, Col } from 'react-bootstrap' // Local libraries import config from '../../config' -import Memo from './get-cid' +// import Memo from './get-cid' function Footer (props) { - const [ipfsCid, setIpfsCid] = useState(config.ipfsCid) + // const [ipfsCid, setIpfsCid] = useState(config.ipfsCid) const wallet = props.appData.wallet // Retrieve the most up-to-date CID for the app on Filecoin from the BCH blockchain. useEffect(() => { async function fetchData () { try { - const hash = await getUpdatedUrl(wallet) - if (hash) { - setIpfsCid(hash) - } + // const hash = await getUpdatedUrl(wallet) + // if (hash) { + // setIpfsCid(hash) + // } } catch (err) { console.error('Error trying to retrieve Filecoin CID for the app from the BCH blockchain.') } @@ -32,56 +32,44 @@ function Footer (props) { return ( - -
Site Mirrors
- - -
Source Code
+ +
) } -async function getUpdatedUrl (wallet) { - try { - // Exit if the wallet is not initialized. - if (!wallet) return +// async function getUpdatedUrl (wallet) { +// try { +// // Exit if the wallet is not initialized. +// if (!wallet) return - // Initialize the memo library for retrieving data from the BCH blockchain. - const memo = new Memo({ bchAddr: config.appBchAddr }) - await memo.initialize(wallet) - const hash = await memo.findHash() +// // Initialize the memo library for retrieving data from the BCH blockchain. +// const memo = new Memo({ bchAddr: config.appBchAddr }) +// await memo.initialize(wallet) +// const hash = await memo.findHash() - if (!hash) { - console.error( - `Could not find IPFS hash in transactions for address ${config.appBchAddr}` - ) - return false - } - // console.log(`latest IPFS hash: ${hash}`) +// if (!hash) { +// console.error( +// `Could not find IPFS hash in transactions for address ${config.appBchAddr}` +// ) +// return false +// } +// // console.log(`latest IPFS hash: ${hash}`) - return hash - } catch (err) { - console.log('Error in getUpdatedUrl(): ', err) - } -} +// return hash +// } catch (err) { +// console.log('Error in getUpdatedUrl(): ', err) +// } +// } export default Footer diff --git a/src/components/nav-menu/index.js b/src/components/nav-menu/index.js index 1e5f8ed..558a84c 100644 --- a/src/components/nav-menu/index.js +++ b/src/components/nav-menu/index.js @@ -37,22 +37,15 @@ function NavMenu (props) { diff --git a/src/components/starter-views.js b/src/components/starter-views.js index 906de1a..1ab1833 100644 --- a/src/components/starter-views.js +++ b/src/components/starter-views.js @@ -20,7 +20,7 @@ export function UninitializedView (props = {}) { denyClose={appData.denyClose} /> { - props.asyncInitFinished + appData.asyncInitFinished ? : null } diff --git a/src/services/async-load.js b/src/services/async-load.js index 3e7b8b6..1cf1bbf 100644 --- a/src/services/async-load.js +++ b/src/services/async-load.js @@ -83,6 +83,10 @@ class AsyncLoad { // Get the BCH balance of the wallet. const bchBalance = await wallet.getBalance({ bchAddress: wallet.walletInfo.cashAddress }) + await wallet.walletInfoPromise + await wallet.initialize() + // console.log(`mnemonic: ${wallet.walletInfo.mnemonic}`) + // Update the state of the wallet with the balances updateBchWalletState({ walletObj: { bchBalance }, appData })