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

Commit

Permalink
fix linkage for MINIMUM_VISIT_TIME and MINIMUM_VISITS
Browse files Browse the repository at this point in the history
and also make contribution date wording more consistent.

auditor: @ayumi

Fix #5200
Fix #5343
  • Loading branch information
mrose17 committed Nov 2, 2016
1 parent 5de9547 commit 42146a3
Show file tree
Hide file tree
Showing 22 changed files with 40 additions and 24 deletions.
2 changes: 1 addition & 1 deletion app/extensions/brave/locales/bn-BD/preferences.properties
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ accountBalanceConnectionError=তথ্য প্রাপ্তিতে ত্
accountBalanceLoading=লোড হচ্ছে
monthlyBudget=মাসিক বাজেট
status=অবস্থা
statusNextReconcileDate=Contribution due date: {{reconcileDate}}.
statusNextReconcileDate=Contribution due date is {{reconcileDate}}.
createWallet=ওয়ালেট তৈরি করুন
createWalletStatus=ওয়ালেট তৈরি করুন বাটনে ক্লিক করে শুরু করুন।
creatingWallet=তৈরি করা হচ্ছে
Expand Down
2 changes: 1 addition & 1 deletion app/extensions/brave/locales/bn-IN/preferences.properties
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ accountBalanceConnectionError=error, can't retrieve data
accountBalanceLoading=loading…
monthlyBudget=monthly budget
status=status
statusNextReconcileDate=Contribution due date: {{reconcileDate}}.
statusNextReconcileDate=Contribution due date is {{reconcileDate}}.
createWallet=create wallet
createWalletStatus=Click the Create Wallet button to get started.
creatingWallet=creating…
Expand Down
2 changes: 1 addition & 1 deletion app/extensions/brave/locales/en-US/preferences.properties
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ accountBalanceConnectionError=error, can't retrieve data
accountBalanceLoading=loading…
monthlyBudget=monthly budget
status=status
statusNextReconcileDate=Contribution due date: {{reconcileDate}}.
statusNextReconcileDate=Contribution due date is {{reconcileDate}}.
createWallet=create wallet
createWalletStatus=Click the Create Wallet button to get started.
creatingWallet=creating…
Expand Down
2 changes: 1 addition & 1 deletion app/extensions/brave/locales/es/preferences.properties
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ accountBalanceConnectionError=error, no se pueden recuperar los datos
accountBalanceLoading=cargando...
monthlyBudget=presupuesto mensual
status=estado
statusNextReconcileDate=Contribution due date: {{reconcileDate}}.
statusNextReconcileDate=Contribution due date is {{reconcileDate}}.
createWallet=crear cartera
createWalletStatus=Haga clic en el botón crear cartera para comenzar.
creatingWallet=creando...
Expand Down
2 changes: 1 addition & 1 deletion app/extensions/brave/locales/eu/preferences.properties
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ accountBalanceConnectionError=Errorea, ezin dira datuak berreskuratu
accountBalanceLoading=Kargatzen...
monthlyBudget=Hileko aurrekontua
status=Egoera
statusNextReconcileDate=Contribution due date: {{reconcileDate}}.
statusNextReconcileDate=Contribution due date is {{reconcileDate}}.
createWallet=Diru-zorroa sortu
createWalletStatus=Sakatu hemen diru-zorroa sortzeko
creatingWallet=sortzen...
Expand Down
2 changes: 1 addition & 1 deletion app/extensions/brave/locales/fr-FR/preferences.properties
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ accountBalanceConnectionError=erreur, impossible de récupérer les données
accountBalanceLoading=chargement...
monthlyBudget=budget mensuel
status=statut
statusNextReconcileDate=Contribution due date: {{reconcileDate}}.
statusNextReconcileDate=Contribution due date is {{reconcileDate}}.
createWallet=créer un porte-monnaie
createWalletStatus=Pour commencer, cliquez sur "créer un porte-monnaie"
creatingWallet=création...
Expand Down
2 changes: 1 addition & 1 deletion app/extensions/brave/locales/hi-IN/preferences.properties
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ accountBalanceConnectionError=error, can't retrieve data
accountBalanceLoading=loading…
monthlyBudget=monthly budget
status=status
statusNextReconcileDate=Contribution due date: {{reconcileDate}}.
statusNextReconcileDate=Contribution due date is {{reconcileDate}}.
createWallet=create wallet
createWalletStatus=Click the Create Wallet button to get started.
creatingWallet=creating…
Expand Down
2 changes: 1 addition & 1 deletion app/extensions/brave/locales/it-IT/preferences.properties
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ accountBalanceConnectionError=errore, impossibile recuperare i dati
accountBalanceLoading=caricamento in corso...
monthlyBudget=budget mensile
status=stato
statusNextReconcileDate=Contribution due date: {{reconcileDate}}.
statusNextReconcileDate=Contribution due date is {{reconcileDate}}.
createWallet=crea portafoglio
createWalletStatus=Fai click sul pulsante Crea Portafoglio per iniziare.
creatingWallet=creazione in corso...
Expand Down
2 changes: 1 addition & 1 deletion app/extensions/brave/locales/ja-JP/preferences.properties
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ accountBalanceConnectionError=エラーが発生しました。データが取
accountBalanceLoading=読み込み中です…
monthlyBudget=毎月の予算
status=状態
statusNextReconcileDate=Contribution due date: {{reconcileDate}}.
statusNextReconcileDate=Contribution due date is {{reconcileDate}}.
createWallet=ウォレットを作る
createWalletStatus=始めるには「ウォレットを作る」ボタンを押してください。
creatingWallet=作っています…
Expand Down
2 changes: 1 addition & 1 deletion app/extensions/brave/locales/ko-KR/preferences.properties
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ accountBalanceConnectionError=오류, 데이터를 검색 할 수 없습니다.
accountBalanceLoading=로딩중...
monthlyBudget=월 예산
status=상태
statusNextReconcileDate=Contribution due date: {{reconcileDate}}.
statusNextReconcileDate=Contribution due date is {{reconcileDate}}.
createWallet=지갑 만들기
createWalletStatus=지갑 만들기 버튼을 클릭하면 시작합니다.
creatingWallet=만들기...
Expand Down
2 changes: 1 addition & 1 deletion app/extensions/brave/locales/nl-NL/preferences.properties
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ accountBalanceConnectionError=error, can't retrieve data
accountBalanceLoading=loading…
monthlyBudget=monthly budget
status=status
statusNextReconcileDate=Contribution due date: {{reconcileDate}}.
statusNextReconcileDate=Contribution due date is {{reconcileDate}}.
createWallet=create wallet
createWalletStatus=Click the Create Wallet button to get started.
creatingWallet=creating…
Expand Down
2 changes: 1 addition & 1 deletion app/extensions/brave/locales/pl-PL/preferences.properties
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ accountBalanceConnectionError=error, can't retrieve data
accountBalanceLoading=loading…
monthlyBudget=monthly budget
status=status
statusNextReconcileDate=Contribution due date: {{reconcileDate}}.
statusNextReconcileDate=Contribution due date is {{reconcileDate}}.
createWallet=create wallet
createWalletStatus=Click the Create Wallet button to get started.
creatingWallet=creating…
Expand Down
2 changes: 1 addition & 1 deletion app/extensions/brave/locales/pt-BR/preferences.properties
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ accountBalanceConnectionError=erro, impossível recuperar dados
accountBalanceLoading=a carregar...
monthlyBudget=orçamento mensal
status=estado
statusNextReconcileDate=Contribution due date: {{reconcileDate}}.
statusNextReconcileDate=Contribution due date is {{reconcileDate}}.
createWallet=criar carteira
createWalletStatus=Clique no botão Criar Carteira para começar:
creatingWallet=a criar...
Expand Down
2 changes: 1 addition & 1 deletion app/extensions/brave/locales/ta/preferences.properties
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ accountBalanceConnectionError=error, can't retrieve data
accountBalanceLoading=loading…
monthlyBudget=monthly budget
status=status
statusNextReconcileDate=Contribution due date: {{reconcileDate}}.
statusNextReconcileDate=Contribution due date is {{reconcileDate}}.
createWallet=create wallet
createWalletStatus=Click the Create Wallet button to get started.
creatingWallet=creating…
Expand Down
2 changes: 1 addition & 1 deletion app/extensions/brave/locales/te/preferences.properties
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ accountBalanceConnectionError=error, can't retrieve data
accountBalanceLoading=loading…
monthlyBudget=monthly budget
status=status
statusNextReconcileDate=Contribution due date: {{reconcileDate}}.
statusNextReconcileDate=Contribution due date is {{reconcileDate}}.
createWallet=create wallet
createWalletStatus=Click the Create Wallet button to get started.
creatingWallet=creating…
Expand Down
2 changes: 1 addition & 1 deletion app/extensions/brave/locales/tr-TR/preferences.properties
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ accountBalanceConnectionError=Hata, veri alınamıyor
accountBalanceLoading=Yükleniyor...
monthlyBudget=Aylık Bütçe
status=Durum
statusNextReconcileDate=Contribution due date: {{reconcileDate}}.
statusNextReconcileDate=Contribution due date is {{reconcileDate}}.
createWallet=Cüzdan Oluştur
createWalletStatus=Başlamak için Cüzdan Oluştur düğmesini tıklayın.
creatingWallet=Oluşturuluyor...
Expand Down
2 changes: 1 addition & 1 deletion app/extensions/brave/locales/uk/preferences.properties
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ accountBalanceConnectionError=помилка, неможливо отримат
accountBalanceLoading=завантаження…
monthlyBudget=місячний бюджет
status=стан
statusNextReconcileDate=Contribution due date: {{reconcileDate}}.
statusNextReconcileDate=Contribution due date is {{reconcileDate}}.
createWallet=створити гаманець
createWalletStatus=Натисніть кнопку Створити гаманець для початку.
creatingWallet=створення…
Expand Down
2 changes: 1 addition & 1 deletion app/extensions/brave/locales/zh-CN/preferences.properties
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ accountBalanceConnectionError=错误,无法检索数据
accountBalanceLoading=正在加载...
monthlyBudget=每月预算
status=状态
statusNextReconcileDate=Contribution due date: {{reconcileDate}}.
statusNextReconcileDate=Contribution due date is {{reconcileDate}}.
createWallet=创建钱包
createWalletStatus=点击“创建钱包”按钮开始
creatingWallet=正在创建...
Expand Down
20 changes: 18 additions & 2 deletions app/ledger.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,11 @@ const doAction = (action) => {
case settings.MINIMUM_VISIT_TIME:
if (action.value <= 0) break

synopsis.options.minDuration = action.value
synopsis.options.minDuration = action.value * 1000
updatePublisherInfo()
break

case settings.MINIMUM_VISTS:
case settings.MINIMUM_VISITS:
if (action.value <= 0) break

synopsis.options.minPublisherVisits = action.value
Expand Down Expand Up @@ -562,7 +562,23 @@ var enable = (paymentsEnabled) => {
synopsis = new (ledgerPublisher.Synopsis)()
fs.readFile(pathName(synopsisPath), (err, data) => {
var initSynopsis = () => {
var value

// cf., the `Synopsis` constructor, https://github.com/brave/ledger-publisher/blob/master/index.js#L167
value = getSetting(settings.MINIMUM_VISIT_TIME)
if (!value) {
value = 8
appActions.changeSetting(settings.MINIMUM_VISIT_TIME, value)
}
if (value > 0) synopsis.options.minDuration = value * 1000

value = getSetting(settings.MINIMUM_VISITS)
if (!value) {
value = 5
appActions.changeSetting(settings.MINIMUM_VISITS, value)
}
if (value > 0) synopsis.options.minPublisherVisits = value

if (process.env.NODE_ENV === 'test') {
synopsis.options.minDuration = 0
synopsis.options.minPublisherDuration = 0
Expand Down
2 changes: 1 addition & 1 deletion js/about/preferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -1001,7 +1001,7 @@ class PaymentsTab extends ImmutableComponent {
<SettingItem>
<select
defaultValue={minPublisherVisits || 5}
onChange={changeSetting.bind(null, this.props.onChangeSetting, settings.MINIMUM_VISTS)}>>>
onChange={changeSetting.bind(null, this.props.onChangeSetting, settings.MINIMUM_VISITS)}>>>
<option value='2'>2 visits</option>
<option value='5'>5 visits</option>
<option value='10'>10 visits</option>
Expand Down
2 changes: 1 addition & 1 deletion js/constants/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const settings = {
SEND_USAGE_STATISTICS: 'advanced.send-usage-statistics',
ADBLOCK_CUSTOM_RULES: 'adblock.customRules',
MINIMUM_VISIT_TIME: 'advanced.minimum-visit-time',
MINIMUM_VISTS: 'advanced.minimum-visits',
MINIMUM_VISITS: 'advanced.minimum-visits',

// DEPRECATED settings
// ########################
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@
"keytar": "^3.0.0",
"l20n": "^3.5.1",
"ledger-balance": "^0.8.61",
"ledger-client": "^0.8.90",
"ledger-client": "^0.8.92",
"ledger-geoip": "^0.8.72",
"ledger-publisher": "^0.8.89",
"ledger-publisher": "^0.8.90",
"lru_cache": "^1.0.0",
"moment": "^2.15.1",
"punycode": "^2.0.0",
Expand Down

0 comments on commit 42146a3

Please sign in to comment.