aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/controllers/currency.js
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2018-04-19 02:41:39 +0800
committerDan <danjm.com@gmail.com>2018-04-19 02:41:39 +0800
commite80bd230b9bb6ac9ff05d7095f74dd2fd7ebb3af (patch)
tree2754e4ddcc39b20fbc4f2e2196e51ee24d05a619 /app/scripts/controllers/currency.js
parent6d96b1a2ab0ac09ca8e5948ff11d2924faef4cd7 (diff)
downloadtangerine-wallet-browser-e80bd230b9bb6ac9ff05d7095f74dd2fd7ebb3af.tar
tangerine-wallet-browser-e80bd230b9bb6ac9ff05d7095f74dd2fd7ebb3af.tar.gz
tangerine-wallet-browser-e80bd230b9bb6ac9ff05d7095f74dd2fd7ebb3af.tar.bz2
tangerine-wallet-browser-e80bd230b9bb6ac9ff05d7095f74dd2fd7ebb3af.tar.lz
tangerine-wallet-browser-e80bd230b9bb6ac9ff05d7095f74dd2fd7ebb3af.tar.xz
tangerine-wallet-browser-e80bd230b9bb6ac9ff05d7095f74dd2fd7ebb3af.tar.zst
tangerine-wallet-browser-e80bd230b9bb6ac9ff05d7095f74dd2fd7ebb3af.zip
NO MIXED TABS AND SPACES
Diffstat (limited to 'app/scripts/controllers/currency.js')
-rw-r--r--app/scripts/controllers/currency.js46
1 files changed, 23 insertions, 23 deletions
diff --git a/app/scripts/controllers/currency.js b/app/scripts/controllers/currency.js
index c23c7f616..37a19ff0d 100644
--- a/app/scripts/controllers/currency.js
+++ b/app/scripts/controllers/currency.js
@@ -6,12 +6,12 @@ const POLLING_INTERVAL = 600000
class CurrencyController {
- /**
- * Controller responsible for managing data associated with the currently selected currency.
- *
+ /**
+ * Controller responsible for managing data associated with the currently selected currency.
+ *
* @typedef {Object} CurrencyController
- * @param {object} opts Overrides the defaults for the initial state of this.store
- * @property {array} opts.initState initializes the the state of the CurrencyController. Can contain an
+ * @param {object} opts Overrides the defaults for the initial state of this.store
+ * @property {array} opts.initState initializes the the state of the CurrencyController. Can contain an
* currentCurrency, conversionRate and conversionDate properties
* @property {string} currentCurrency A 2-4 character shorthand that describes a specific currency, currently
* selected by the user
@@ -20,8 +20,8 @@ class CurrencyController {
* since midnight of January 1, 1970
* @property {number} conversionInterval The id of the interval created by the scheduleConversionInterval method.
* Used to clear an existing interval on subsequent calls of that method.
- *
- */
+ *
+ */
constructor (opts = {}) {
const initState = extend({
currentCurrency: 'usd',
@@ -35,22 +35,22 @@ class CurrencyController {
// PUBLIC METHODS
//
- /**
- * A getter for the currentCurrency property
- *
- * @returns {string} A 2-4 character shorthand that describes a specific currency, currently selected by the user
- *
- */
+ /**
+ * A getter for the currentCurrency property
+ *
+ * @returns {string} A 2-4 character shorthand that describes a specific currency, currently selected by the user
+ *
+ */
getCurrentCurrency () {
return this.store.getState().currentCurrency
}
- /**
- * A setter for the currentCurrency property
- *
- * @param {string} currentCurrency The new currency to set as the currentCurrency in the store
- *
- */
+ /**
+ * A setter for the currentCurrency property
+ *
+ * @param {string} currentCurrency The new currency to set as the currentCurrency in the store
+ *
+ */
setCurrentCurrency (currentCurrency) {
this.store.updateState({ currentCurrency })
}
@@ -117,12 +117,12 @@ class CurrencyController {
}
}
- /**
- * Creates a new poll, using setInterval, to periodically call updateConversionRate. The id of the interval is
+ /**
+ * Creates a new poll, using setInterval, to periodically call updateConversionRate. The id of the interval is
* stored at the controller's conversionInterval property. If it is called and such an id already exists, the
* previous interval is clear and a new one is created.
- *
- */
+ *
+ */
scheduleConversionInterval () {
if (this.conversionInterval) {
clearInterval(this.conversionInterval)