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 authored Dec 18, 2018
2 parents ad4cdff + 12342c9 commit fbd9627
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 @@ -636,6 +636,7 @@ void RewardsServiceImpl::OnGrantFinish(ledger::Result result,
grant.probi);
}

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

Expand All @@ -654,6 +655,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 @@ -52,6 +52,7 @@ class SettingsPage extends React.Component<Props, {}> {
this.actions.getContributeList()
this.actions.checkImported()
this.actions.getAdsData()
this.actions.getCurrentReport()
}

componentWillUnmount () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,6 @@ export const enum types {
ON_IMPORTED_CHECK = '@@rewards/ON_IMPORTED_CHECK',
GET_ADS_DATA = '@@rewards/GET_ADS_DATA',
ON_ADS_DATA = '@@rewards/ON_ADS_DATA',
ON_ADS_SETTING_SAVE = '@@rewards/ON_ADS_SETTING_SAVE'
ON_ADS_SETTING_SAVE = '@@rewards/ON_ADS_SETTING_SAVE',
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 fbd9627

Please sign in to comment.