Skip to content

Commit

Permalink
Merge pull request #1126 from brave/fix-2273
Browse files Browse the repository at this point in the history
Fixes tipping report inconsistencies
  • Loading branch information
NejcZdovc committed Jan 14, 2019
1 parent e97cf10 commit 0d739b9
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 1 deletion.
2 changes: 2 additions & 0 deletions components/brave_rewards/browser/rewards_service_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,7 @@ void RewardsServiceImpl::OnGrantFinish(ledger::Result result,
grant.probi);
}

GetCurrentBalanceReport();
TriggerOnGrantFinish(result, grant);
}

Expand All @@ -625,6 +626,7 @@ void RewardsServiceImpl::OnReconcileComplete(ledger::Result result,
GetCurrentTimestamp());
}

GetCurrentBalanceReport();
for (auto& observer : observers_)
observer.OnReconcileComplete(this,
result,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ export const onBalanceReports = (reports: Record<string, Rewards.Report>) => act
reports
})

export const getCurrentReport = () => action(types.GET_CURRENT_REPORT, {})

export const excludePublisher = (publisherKey: string) => action(types.ON_EXCLUDE_PUBLISHER, {
publisherKey
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class SettingsPage extends React.Component<Props, {}> {
this.actions.checkImported()
this.actions.getAdsData()
this.actions.getPendingContributionsTotal()
this.actions.getCurrentReport()
}

componentWillUnmount () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,6 @@ export const enum types {
ON_ADS_DATA = '@@rewards/ON_ADS_DATA',
ON_ADS_SETTING_SAVE = '@@rewards/ON_ADS_SETTING_SAVE',
GET_PENDING_CONTRIBUTION_TOTAL = '@@rewards/GET_PENDING_CONTRIBUTION_TOTAL',
ON_PENDING_CONTRIBUTION_TOTAL = '@@rewards/ON_PENDING_CONTRIBUTION_TOTAL'
ON_PENDING_CONTRIBUTION_TOTAL = '@@rewards/ON_PENDING_CONTRIBUTION_TOTAL',
GET_CURRENT_REPORT = '@@rewards/GET_CURRENT_REPORT'
}
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,11 @@ const walletReducer: Reducer<Rewards.State | undefined> = (state: Rewards.State,
}
break
}
case types.GET_CURRENT_REPORT:
{
chrome.send('brave_rewards.getBalanceReports')
break
}
case types.ON_BALANCE_REPORTS:
{
state = { ...state }
Expand Down

0 comments on commit 0d739b9

Please sign in to comment.