Skip to content

Commit

Permalink
Fixes auto unpinning for payment publishers
Browse files Browse the repository at this point in the history
Resolves brave#11369

Auditors:

Test Plan:
  • Loading branch information
NejcZdovc committed Oct 9, 2017
1 parent ba3de19 commit 6def5b9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions app/browser/api/ledger.js
Original file line number Diff line number Diff line change
Expand Up @@ -717,8 +717,8 @@ const synopsisNormalizer = (state, changedPublisher, returnState) => {
const publisherKey = item.site
const weight = item.weight
const pinPercentage = item.pinPercentage
savePublisherOption(publisherKey, 'weight', weight)
savePublisherOption(publisherKey, 'pinPercentage', pinPercentage)
savePublisherData(publisherKey, 'weight', weight)
savePublisherData(publisherKey, 'pinPercentage', pinPercentage)
state = ledgerState.setPublishersProp(state, publisherKey, 'weight', weight)
state = ledgerState.setPublishersProp(state, publisherKey, 'pinPercentage', pinPercentage)
})
Expand Down Expand Up @@ -2227,6 +2227,12 @@ const savePublisherOption = (publisherKey, prop, value) => {
}
}

const savePublisherData = (publisherKey, prop, value) => {
if (synopsis.publishers && synopsis.publishers[publisherKey]) {
synopsis.publishers[publisherKey][prop] = value
}
}

const deleteSynopsis = () => {
synopsis.publishers = {}
}
Expand Down

0 comments on commit 6def5b9

Please sign in to comment.