Skip to content

Commit

Permalink
Fixes stuck reconile stamp
Browse files Browse the repository at this point in the history
  • Loading branch information
NejcZdovc committed Dec 21, 2018
1 parent 2bd242d commit c5fc4c7
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,3 +151,5 @@ export const onAdsSettingSave = (key: string, value: any) => action(types.ON_ADS
key,
value
})

export const getReconcileStamp = () => action(types.GET_RECONCILE_STAMP)
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,13 @@ class SettingsPage extends React.Component<Props, {}> {
this.actions.getWalletProperties()
}, 60000)

this.actions.getGrant()
this.actions.getCurrentReport()
this.actions.getDonationTable()
this.actions.getContributeList()
this.actions.checkImported()
this.actions.getAdsData()
this.actions.getCurrentReport()
this.actions.checkImported()
this.actions.getReconcileStamp()
this.actions.getGrant()
}

componentWillUnmount () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,6 @@ export const enum types {
GET_ADS_DATA = '@@rewards/GET_ADS_DATA',
ON_ADS_DATA = '@@rewards/ON_ADS_DATA',
ON_ADS_SETTING_SAVE = '@@rewards/ON_ADS_SETTING_SAVE',
GET_CURRENT_REPORT = '@@rewards/GET_CURRENT_REPORT'
GET_CURRENT_REPORT = '@@rewards/GET_CURRENT_REPORT',
GET_RECONCILE_STAMP = '@@rewards/GET_RECONCILE_STAMP'
}
19 changes: 12 additions & 7 deletions components/brave_rewards/resources/ui/reducers/wallet_reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ const createWallet = (state: Rewards.State) => {
state.enabledContribute = true
state.createdTimestamp = new Date().getTime()

chrome.send('brave_rewards.getReconcileStamp', [])
chrome.send('brave_rewards.getAddresses', [])
chrome.send('brave_rewards.getReconcileStamp')
chrome.send('brave_rewards.getAddresses')

return state
}
Expand All @@ -27,7 +27,7 @@ const walletReducer: Reducer<Rewards.State | undefined> = (state: Rewards.State,
state = { ...state }
state.walletCreateFailed = false
state.walletCreated = false
chrome.send('brave_rewards.createWalletRequested', [])
chrome.send('brave_rewards.createWalletRequested')
break
case types.WALLET_CREATED:
state = { ...state }
Expand All @@ -38,7 +38,7 @@ const walletReducer: Reducer<Rewards.State | undefined> = (state: Rewards.State,
state.walletCreateFailed = true
break
case types.GET_WALLET_PROPERTIES:
chrome.send('brave_rewards.getWalletProperties', [])
chrome.send('brave_rewards.getWalletProperties')
break
case types.ON_WALLET_PROPERTIES:
{
Expand Down Expand Up @@ -68,7 +68,7 @@ const walletReducer: Reducer<Rewards.State | undefined> = (state: Rewards.State,
break
}
case types.GET_WALLLET_PASSPHRASE:
chrome.send('brave_rewards.getWalletPassphrase', [])
chrome.send('brave_rewards.getWalletPassphrase')
break
case types.ON_WALLLET_PASSPHRASE:
const value = action.payload.pass
Expand Down Expand Up @@ -106,8 +106,8 @@ const walletReducer: Reducer<Rewards.State | undefined> = (state: Rewards.State,
if (result === 0) {
walletInfo.balance = balance
walletInfo.grants = grants || []
chrome.send('brave_rewards.getWalletPassphrase', [])
chrome.send('brave_rewards.getAddresses', [])
chrome.send('brave_rewards.getWalletPassphrase')
chrome.send('brave_rewards.getAddresses')
ui.emptyWallet = balance <= 0
ui.modalBackup = false
ui.walletCorrupted = false
Expand Down Expand Up @@ -202,6 +202,11 @@ const walletReducer: Reducer<Rewards.State | undefined> = (state: Rewards.State,
state.contributionMonthly = action.payload.amount
break
}
case types.GET_RECONCILE_STAMP:
{
chrome.send('brave_rewards.getReconcileStamp')
break
}
}

return state
Expand Down

0 comments on commit c5fc4c7

Please sign in to comment.