Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Legacy fix for wrong addresses #1173

Merged
merged 1 commit into from
Dec 22, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 getAddresses = () => action(types.GET_ADDRESSES)
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ class SettingsPage extends React.Component<Props, {}> {
this.actions.checkImported()
this.actions.getAdsData()
this.actions.getCurrentReport()

// one time check (legacy fix)
// more info here https://github.com/brave/brave-browser/issues/2172
if (!this.props.rewardsData.ui.addressCheck) {
this.actions.getAddresses()
}
}

componentWillUnmount () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,20 @@ const walletReducer: Reducer<Rewards.State | undefined> = (state: Rewards.State,
state.contributionMonthly = action.payload.amount
break
}
case types.GET_ADDRESSES:
{
state = { ...state }
let ui = state.ui
ui.addressCheck = true

chrome.send('brave_rewards.getAddresses')

state = {
...state,
ui
}

}
}

return state
Expand Down
1 change: 1 addition & 0 deletions components/brave_rewards/resources/ui/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export const defaultState: Rewards.State = {
recoveryKey: '',
reconcileStamp: 0,
ui: {
addressCheck: false,
emptyWallet: true,
modalBackup: false,
walletCorrupted: false,
Expand Down
1 change: 1 addition & 0 deletions components/definitions/rewards.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ declare namespace Rewards {
tipsList: Publisher[]
tipsLoad: boolean
ui: {
addressCheck: boolean
emptyWallet: boolean
modalBackup: boolean
walletRecoverySuccess: boolean | null
Expand Down