Skip to content

Commit

Permalink
Merge pull request #5066 from brave/ntp-blank
Browse files Browse the repository at this point in the history
Fixes ntp blank page
  • Loading branch information
NejcZdovc authored Mar 26, 2020
2 parents 61e4302 + 1b5210c commit db1ecd8
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 27 deletions.
2 changes: 1 addition & 1 deletion components/brave_new_tab_ui/rewards-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ export const getTotalContributions = (report: NewTab.RewardsBalanceReport) => {
return 0.0
}

return report.tips + report.contribute + report.donation
return report.tips + report.contribute + report.monthly
}
11 changes: 0 additions & 11 deletions components/brave_rewards/resources/android_page/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */

import BigNumber from 'bignumber.js'

export let actions: any = null

export const getActions = () => actions
Expand Down Expand Up @@ -40,15 +38,6 @@ export const generateContributionMonthly = (list: number[], rates: Record<string
})
}

export const tipsTotal = (report: Rewards.BalanceReport) => {
if (!report) {
return '0.0'
}

const tips = new BigNumber(report.tips)
return new BigNumber(report.donation).plus(tips).dividedBy('1e18').toFixed(1, BigNumber.ROUND_DOWN)
}

export const tipsListTotal = (list: Rewards.Publisher[]) => {
if (list.length === 0) {
return 0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const defaultState: RewardsExtension.State = {
balanceReport: {
ads: 0.0,
contribute: 0.0,
donation: 0.0,
monthly: 0.0,
grant: 0.0,
tips: 0.0
},
Expand Down
11 changes: 0 additions & 11 deletions components/brave_rewards/resources/page/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */

import BigNumber from 'bignumber.js'

export let actions: any = null

export const getActions = () => actions
Expand Down Expand Up @@ -40,15 +38,6 @@ export const generateContributionMonthly = (list: number[], rates: Record<string
})
}

export const tipsTotal = (report: Rewards.BalanceReport) => {
if (!report) {
return '0.0'
}

const tips = new BigNumber(report.tips)
return new BigNumber(report.donation).plus(tips).dividedBy('1e18').toFixed(1, BigNumber.ROUND_DOWN)
}

export const tipsListTotal = (list: Rewards.Publisher[]) => {
if (list.length === 0) {
return 0.0
Expand Down
2 changes: 1 addition & 1 deletion components/definitions/newTab.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ declare namespace NewTab {
export interface RewardsBalanceReport {
ads: number
contribute: number
donation: number
monthly: number
grant: number
tips: number
}
Expand Down
2 changes: 1 addition & 1 deletion components/definitions/rewards.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ declare namespace Rewards {
export interface BalanceReport {
ads: number
contribute: number
donation: number
monthly: number
grant: number
tips: number
}
Expand Down
2 changes: 1 addition & 1 deletion components/definitions/rewardsExtensions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ declare namespace RewardsExtension {
export interface BalanceReport {
ads: number
contribute: number
donation: number
monthly: number
grant: number
tips: number
}
Expand Down

0 comments on commit db1ecd8

Please sign in to comment.