diff --git a/src/components/WalletButton.js b/src/components/WalletButton.js index 11b312a..06a24fe 100644 --- a/src/components/WalletButton.js +++ b/src/components/WalletButton.js @@ -35,7 +35,7 @@ export const WalletButton = ({ ...rest }) => { console.error('get_register() error:' + err.message) }) - // checkAuth(address) + checkAuth(address) } const connect = async () => { diff --git a/src/pages/Account.js b/src/pages/Account.js index 4d5e1fd..26821e4 100644 --- a/src/pages/Account.js +++ b/src/pages/Account.js @@ -59,33 +59,33 @@ export const Account = () => { } React.useEffect(() => { - // if (app.address) { - get_page_account('0xb308ED17897105cAac3f9813DD35c2eBc64b9A65').then(res => { - console.log(res.data) - const d = res.data - let newAccount = [...accountData] - newAccount[0].value = d.output - newAccount[1].value = d.balance - newAccount[2].value = d.withdrawal - setAccountInfo(newAccount) + if (app.address) { + get_page_account(app.address).then(res => { + // console.log(res.data) + const d = res.data + let newAccount = [...accountData] + newAccount[0].value = d.output + newAccount[1].value = d.balance + newAccount[2].value = d.withdrawal + setAccountInfo(newAccount) - }).catch(err => { - console.error(err.message) - }) + }).catch(err => { + console.error(err.message) + }) - get_withdrawal_history('0xb308ED17897105cAac3f9813DD35c2eBc64b9A65').then(res => { - setWithdrawalHist(res.data) - console.log(res.data) - }) - get_daily_revenue_history('0xb308ED17897105cAac3f9813DD35c2eBc64b9A65').then(res => { - setDailyRevenueHist(res.data) - console.log(res.data) - }) - get_reward_history('0xb308ED17897105cAac3f9813DD35c2eBc64b9A65').then(res => { - setRewardHist(res.data) - console.log(res.data) - }) - // } + get_withdrawal_history(app.address).then(res => { + setWithdrawalHist(res.data) + // console.log(res.data) + }) + get_daily_revenue_history(app.address).then(res => { + setDailyRevenueHist(res.data) + // console.log(res.data) + }) + get_reward_history(app.address).then(res => { + setRewardHist(res.data) + // console.log(res.data) + }) + } }, [app.address]) return ( diff --git a/src/pages/Staking.js b/src/pages/Staking.js index cec22cc..3b93eed 100644 --- a/src/pages/Staking.js +++ b/src/pages/Staking.js @@ -56,7 +56,7 @@ export const Staking = () => { get_staking_balance(app.address).then((res) => { setBalance(res.data) - console.log(res.data) + // console.log(res.data) }) }