diff --git a/components/brave_rewards/browser/rewards_service_impl.cc b/components/brave_rewards/browser/rewards_service_impl.cc index 949b64fb18d5..00104b13bd01 100644 --- a/components/brave_rewards/browser/rewards_service_impl.cc +++ b/components/brave_rewards/browser/rewards_service_impl.cc @@ -606,6 +606,7 @@ void RewardsServiceImpl::OnGrantFinish(ledger::Result result, grant.probi); } + GetCurrentBalanceReport(); TriggerOnGrantFinish(result, grant); } @@ -624,6 +625,7 @@ void RewardsServiceImpl::OnReconcileComplete(ledger::Result result, GetCurrentTimestamp()); } + GetCurrentBalanceReport(); for (auto& observer : observers_) observer.OnReconcileComplete(this, result, diff --git a/components/brave_rewards/resources/ui/actions/rewards_actions.ts b/components/brave_rewards/resources/ui/actions/rewards_actions.ts index 143e241c512c..8cd14cd7d94e 100644 --- a/components/brave_rewards/resources/ui/actions/rewards_actions.ts +++ b/components/brave_rewards/resources/ui/actions/rewards_actions.ts @@ -93,6 +93,8 @@ export const onBalanceReports = (reports: Record) => act reports }) +export const getCurrentReport = () => action(types.GET_CURRENT_REPORT, {}) + export const excludePublisher = (publisherKey: string) => action(types.ON_EXCLUDE_PUBLISHER, { publisherKey }) diff --git a/components/brave_rewards/resources/ui/components/settingsPage.tsx b/components/brave_rewards/resources/ui/components/settingsPage.tsx index 3e33869862c8..16f767d56417 100644 --- a/components/brave_rewards/resources/ui/components/settingsPage.tsx +++ b/components/brave_rewards/resources/ui/components/settingsPage.tsx @@ -52,6 +52,7 @@ class SettingsPage extends React.Component { this.actions.getContributeList() this.actions.checkImported() this.actions.getAdsData() + this.actions.getCurrentReport() } componentWillUnmount () { diff --git a/components/brave_rewards/resources/ui/constants/rewards_types.ts b/components/brave_rewards/resources/ui/constants/rewards_types.ts index c01a50e559c9..c6f45f1d1107 100644 --- a/components/brave_rewards/resources/ui/constants/rewards_types.ts +++ b/components/brave_rewards/resources/ui/constants/rewards_types.ts @@ -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' } diff --git a/components/brave_rewards/resources/ui/reducers/wallet_reducer.ts b/components/brave_rewards/resources/ui/reducers/wallet_reducer.ts index 3592c021dd5d..872f45f5c04f 100644 --- a/components/brave_rewards/resources/ui/reducers/wallet_reducer.ts +++ b/components/brave_rewards/resources/ui/reducers/wallet_reducer.ts @@ -170,6 +170,11 @@ const walletReducer: Reducer = (state: Rewards.State, } break } + case types.GET_CURRENT_REPORT: + { + chrome.send('brave_rewards.getBalanceReports') + break + } case types.ON_BALANCE_REPORTS: { state = { ...state }