Merge pull request #69 from Permissionless-Software-Foundation/ct-unstable

Error handling for memo-get
This commit is contained in:
Chris Troutner
2020-09-21 14:20:24 -07:00
committed by GitHub
7 changed files with 2320 additions and 1257 deletions
+2296 -1241
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "gatsby-ipfs-web-wallet",
"description": "A gatsbyjs app with adminlte2 integration and basic Bitcoin Cash wallet functionality.",
"version": "1.0.4",
"version": "1.9.13",
"main": "index.js",
"author": "Chris Troutner <chris.troutner@gmail.com>",
"contributors": [
+1 -1
View File
@@ -49,8 +49,8 @@ class AdminLTEPage extends React.Component {
_this.BchWallet = BchWallet
_this.sidebar = [
<Item icon='fa-exchange-alt' key='SendReceive' text='Send/Receive' />,
<Item icon='fas-coins' key='Tokens' text='Tokens' activeOn='/' />,
<Item icon='fa-exchange-alt' key='SendReceive' text='Send/Receive' />,
<Item icon='fa-wallet' key='Wallet' text='Wallet' />,
<Item icon='fa-qrcode' key='qrReader' text='Qr Scanner' />,
<Item icon='fas-cog' key='Configure' text='Configure' />
+1 -2
View File
@@ -142,7 +142,7 @@ class Tokens extends React.Component {
await bchWallet.walletInfoPromise
if(_this.props.tokensInfo.length > 0 && refresh === null) {
if (_this.props.tokensInfo.length > 0 && refresh === null) {
tokens = _this.props.tokensInfo
} else {
tokens = await bchWallet.listTokens()
@@ -157,7 +157,6 @@ class Tokens extends React.Component {
})
_this.props.setTokensInfo(tokens)
} catch (error) {
_this.handleError(error)
}
+19 -10
View File
@@ -22,13 +22,24 @@ class Footer extends React.Component {
}
async componentDidMount () {
const addr = 'bitcoincash:qq8mk8etntclfdkny2aknh4ylc0uaewalszh5eytnr'
const hash = await memoGet.read(addr)
console.log(`hash: ${hash}`)
this.setState({
ipfsHash: hash,
ipfsHashLink: `https://ipfs-gateway.fullstack.cash/ipfs/${hash}`
})
try {
const addr = 'bitcoincash:qq8mk8etntclfdkny2aknh4ylc0uaewalszh5eytnr'
const hash = await memoGet.read(addr)
console.log(`hash: ${hash}`)
this.setState({
ipfsHash: hash,
ipfsHashLink: `https://ipfs-gateway.fullstack.cash/ipfs/${hash}`
})
} catch (err) {
console.error('Error trying to retrieve IPFS hash for the site: ', err)
// Manually set an old hash.
const hash = 'QmVm1y1MX4YPzmgQiAafY96Pq7j6GTNMFNuvHki1jAwxYg'
this.setState({
ipfsHash: hash,
ipfsHashLink: `https://ipfs-gateway.fullstack.cash/ipfs/${hash}`
})
}
// const bchjs = new BCHJS()
// const balance = await bchjs.Blockbook.balance(addr)
@@ -96,9 +107,7 @@ class Footer extends React.Component {
<b>IPFS</b>
</span>
<b>|</b>
<a href={_this.state.ipfsHashLink}>
{this.state.ipfsHash}
</a>
<a href={_this.state.ipfsHashLink}>{this.state.ipfsHash}</a>
</li>
</ul>
</div>
+1 -1
View File
@@ -19,7 +19,7 @@ const mapDispatchToProps = dispatch => {
return {
setWalletInfo: value => dispatch({ type: 'SET_WALLET_INFO', value }),
updateBalance: value => dispatch({ type: 'UPDATE_BALANCE', value }),
setBchWallet: value => dispatch({ type: 'SET_BCH_WALLET', value }),
setBchWallet: value => dispatch({ type: 'SET_BCH_WALLET', value }),
setTokensInfo: value => dispatch({ type: 'SET_TOKENS_INFO', value })
}
}
+1 -1
View File
@@ -47,7 +47,7 @@ const reducer = (state, action) => {
})
}
// Get or update tokens information
// Get or update tokens information
if (action.type === 'SET_TOKENS_INFO') {
return Object.assign({}, state, {
tokensInfo: action.value