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 31, 2018
1 parent 3a4c91a commit 42a0e9f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,3 +153,5 @@ export const onAdsSettingSave = (key: string, value: any) => action(types.ON_ADS
})

export const getAddresses = () => action(types.GET_ADDRESSES)

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()

// one time check (legacy fix)
// more info here https://github.com/brave/brave-browser/issues/2172
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'
}
21 changes: 13 additions & 8 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 @@ -111,8 +111,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 @@ -219,7 +219,12 @@ const walletReducer: Reducer<Rewards.State | undefined> = (state: Rewards.State,
...state,
ui
}

break
}
case types.GET_RECONCILE_STAMP:
{
chrome.send('brave_rewards.getReconcileStamp')
break
}
}

Expand Down

0 comments on commit 42a0e9f

Please sign in to comment.