Skip to content

Commit

Permalink
Merge pull request #413 from brave/balance-check
Browse files Browse the repository at this point in the history
Adds balance check
  • Loading branch information
Jason Sadler authored Sep 7, 2018
2 parents 0100b25 + 2c8d816 commit 5ae102e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions components/brave_rewards/ui/components/settingsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ interface Props extends Rewards.ComponentProps {
}

class SettingsPage extends React.Component<Props, {}> {
private balanceTimerId: number

onToggle = () => {
this.actions.onSettingSave('enabledMain', !this.props.rewardsData.enabledMain)
}
Expand All @@ -41,9 +43,17 @@ class SettingsPage extends React.Component<Props, {}> {
}

this.actions.getWalletProperties()
this.balanceTimerId = setInterval(() => {
this.actions.getWalletProperties()
}, 60000)

this.actions.getGrant()
}

componentWillUnmount () {
clearInterval(this.balanceTimerId)
}

render () {
const { enabledMain, grant } = this.props.rewardsData

Expand Down

0 comments on commit 5ae102e

Please sign in to comment.