Skip to content

Commit

Permalink
Fixes upgrade path for promotions
Browse files Browse the repository at this point in the history
  • Loading branch information
NejcZdovc committed Nov 20, 2019
1 parent 2894c1f commit a73d0e1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions components/brave_new_tab_ui/reducers/new_tab_reducer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,10 @@ export const newTabReducer: Reducer<NewTab.State | undefined> = (state: NewTab.S

state = { ...state }

if (!state.rewardsState.promotions) {
state.rewardsState.promotions = []
}

promotions.forEach((promotion: NewTab.Promotion) => {
if (!state || !state.rewardsState) {
return
Expand Down Expand Up @@ -368,6 +372,10 @@ export const newTabReducer: Reducer<NewTab.State | undefined> = (state: NewTab.S
break
}

if (!state.rewardsState.promotions) {
state.rewardsState.promotions = []
}

state = { ...state }
const oldNotifications = state.rewardsState.dismissedNotifications

Expand Down

0 comments on commit a73d0e1

Please sign in to comment.