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

Add entry point in app/ledger.js for setting monthly contribution amount #3197

Closed
diracdeltas opened this issue Aug 16, 2016 · 5 comments
Closed

Comments

@diracdeltas
Copy link
Member

this is required by the specs for the Payments tab in #2497

@mrose17
Copy link
Member

mrose17 commented Aug 17, 2016

@diracdeltas - in the ledger-client package, i have the setBraveryProperties method. what i don't know is how to be told when the setting changes. what do i need to do in ledger.js? thanks!

@diracdeltas
Copy link
Member Author

@mrose17 you can get the user pref for monthly contribution amount in app/ledger.js via getSetting(settings.PAYMENTS_MONTLY_AMOUNT). this is a number that represents the amount in USD, defaults to 5.

to listen for the actual change event, you can probably do

ipc.on(messages.CHANGE_SETTING, (e, key, value) => {
  if (key === settings.PAYMENTS_MONTHLY_AMOUNT) {
    // etc
  }
})

@mrose17
Copy link
Member

mrose17 commented Aug 17, 2016

@diracdeltas - that's very helpful... i'm adding this now. a couple of suggestions:

  1. a better name is PAYMENTS_CONTRIBUTION_AMOUNT: the contribution doesn't occur monthly, but every 30 days (the #-days is configurable on the ledger)
  2. i suggest we add PAYMENTS_CONTRIBUTION_CURRENCY: contributions are always in BTC, but users may feel more comfortable using their local fiat currency (e.g, 4.50EUR, 3.75GBP, etc).

thanks!

@mrose17
Copy link
Member

mrose17 commented Aug 17, 2016

support for PAYMENTS_MONTHLY_AMOUNT added in 86583f1

leaving this issue open until @diracdeltas indicates the thinking on the two suggestions above!

@diracdeltas
Copy link
Member Author

re: suggestion 1, will do right now
re: suggestion 2, we can eventually add a select box for user to pick their currency, but for now I will just set the monthly contrib currency default to whatever the currency property of ledgerInfo is

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

No branches or pull requests

2 participants