shesek / spark-wallet

⚡️ A minimalistic wallet GUI for c-lightning, accessible over the web or through mobile and desktop apps.
MIT License
345 stars 77 forks source link

Option to configure/disable exchange rate polling #15

Open Desuuuu opened 6 years ago

Desuuuu commented 6 years ago

I feel like a startup option to configure/disable exchange rate polling would be useful.

shesek commented 6 years ago

I can see why users would want to change the poll interval, but why would they want to disable it?

If we do add a way to disable rate polling entirely, this should also make the "usd" option disappear from the UI.

Desuuuu commented 6 years ago

People who do not need the rates or do not want to contact Bitstamp might want to disable it.

As far as the UI goes, I guess the change boils down to adding some logic that prevents toggling the unit to USD when the btcusd rate is not available. I had a look at the code to see how I would go about this, but I must say the code was a bit too intricate for me to figure it out right now.

shesek commented 6 years ago

I'll look into implementing this. This will require some refactoring in the way currency units are handled, so might take me a little while to get to it.

Desuuuu commented 6 years ago

On a side note, I think you would appeal to more contributors if the codebase was easier for someone to get his hands on.

For example from what I've seen, the code contains a lot of inline arrow functions (sometimes quite complex), which saves a few lines of code, but really hinders readability.

shesek commented 6 years ago

Thanks, I'll look into improving readability. But note that other than the terse style, the usage of stream-based reactive programming also creates a non-negligible barrier to entry, as its not a very common programming style. I think that programmers experienced with this style would find the terse code easier to parse.