Skip to content

Commit

Permalink
Fixes blank page on rewards
Browse files Browse the repository at this point in the history
  • Loading branch information
NejcZdovc committed Jul 2, 2020
1 parent 2da6765 commit 07bfa38
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const publishersReducer: Reducer<Rewards.State | undefined> = (state: Rewards.St
} else {
state.recurringLoad = true
}
state.recurringList = action.payload.list
state.recurringList = action.payload.list || []
break
case types.REMOVE_RECURRING_TIP:
if (!action.payload.publisherKey) {
Expand All @@ -72,7 +72,7 @@ const publishersReducer: Reducer<Rewards.State | undefined> = (state: Rewards.St
} else {
state.tipsLoad = true
}
state.tipsList = action.payload.list
state.tipsList = action.payload.list || []
break
case types.ON_RECURRING_TIP_SAVED:
case types.ON_RECURRING_TIP_REMOVED:
Expand Down
2 changes: 1 addition & 1 deletion components/brave_rewards/resources/android_page/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const generateContributionMonthly = (properties: Rewards.RewardsParameter
}

export const tipsListTotal = (list: Rewards.Publisher[]) => {
if (list.length === 0) {
if (!list || list.length === 0) {
return 0.0
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const publishersReducer: Reducer<Rewards.State | undefined> = (state: Rewards.St
} else {
state.recurringLoad = true
}
state.recurringList = action.payload.list
state.recurringList = action.payload.list || []
break
case types.REMOVE_RECURRING_TIP:
if (!action.payload.publisherKey) {
Expand All @@ -72,7 +72,7 @@ const publishersReducer: Reducer<Rewards.State | undefined> = (state: Rewards.St
} else {
state.tipsLoad = true
}
state.tipsList = action.payload.list
state.tipsList = action.payload.list || []
break
case types.ON_RECURRING_TIP_SAVED:
case types.ON_RECURRING_TIP_REMOVED:
Expand Down
2 changes: 1 addition & 1 deletion components/brave_rewards/resources/page/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const generateContributionMonthly = (properties: Rewards.RewardsParameter
}

export const tipsListTotal = (list: Rewards.Publisher[]) => {
if (list.length === 0) {
if (!list || list.length === 0) {
return 0.0
}

Expand Down

0 comments on commit 07bfa38

Please sign in to comment.