Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Auto-include propagates correctly
Browse files Browse the repository at this point in the history
Resolves #7451

Auditors: @mrose17

Test Plan:
- Enable payments in settings
- Disable auto-include switch
- Visit brianbondy.com in a new tab, site is added in the list and is not included
  • Loading branch information
NejcZdovc committed Mar 14, 2017
1 parent 5a889cc commit fa56568
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
9 changes: 7 additions & 2 deletions app/ledger.js
Original file line number Diff line number Diff line change
Expand Up @@ -594,9 +594,14 @@ eventStore.addChangeListener(() => {
pattern = `https?://${publisher}`
initP = !synopsis.publishers[publisher]
synopsis.initPublisher(publisher)
if ((initP) && (getSetting(settings.AUTO_SUGGEST_SITES))) {
if (initP) {
excludeP(publisher, (unused, exclude) => {
appActions.changeSiteSetting(pattern, 'ledgerPayments', !exclude)
if (!getSetting(settings.AUTO_SUGGEST_SITES)) {
exclude = false
} else {
exclude = !exclude
}
appActions.changeSiteSetting(pattern, 'ledgerPayments', exclude)
updatePublisherInfo()
})
}
Expand Down
6 changes: 3 additions & 3 deletions app/renderer/components/preferences/payment/ledgerTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class LedgerTable extends ImmutableComponent {
return result
}
}
return true
return getSetting(settings.AUTO_SUGGEST_SITES, this.props.settings)
}

shouldShow (synopsis) {
Expand Down Expand Up @@ -101,7 +101,7 @@ class LedgerTable extends ImmutableComponent {
const publisherURL = synopsis.get('publisherURL')
const percentage = synopsis.get('percentage')
const site = synopsis.get('site')
const defaultSiteSetting = true
const defaultAutoInclude = this.enabledForSite(synopsis)

return [
{
Expand Down Expand Up @@ -131,7 +131,7 @@ class LedgerTable extends ImmutableComponent {
{
html: <SiteSettingCheckbox small
hostPattern={this.getHostPattern(synopsis)}
defaultValue={defaultSiteSetting}
defaultValue={defaultAutoInclude}
prefKey='ledgerPayments'
siteSettings={this.props.siteSettings}
checked={this.enabledForSite(synopsis)} />,
Expand Down

0 comments on commit fa56568

Please sign in to comment.