|
2 | 2 | * @fileOverview computed values that are used in settings UI components. |
3 | 3 | */ |
4 | 4 |
|
5 | | -import { computed, extendObservable } from 'mobx'; |
| 5 | +import { extendObservable } from 'mobx'; |
6 | 6 | import { formatNumber } from '../helper'; |
7 | 7 | import { UNITS, FIATS } from '../config'; |
8 | 8 |
|
9 | 9 | const ComputedSetting = store => { |
10 | 10 | extendObservable(store, { |
11 | | - selectedUnitLabel: computed(() => getUnitLabel(store.settings.unit)), |
12 | | - selectedFiatLabel: computed(() => FIATS[store.settings.fiat].displayLong), |
13 | | - satUnitLabel: computed(() => getUnitLabel('sat')), |
14 | | - bitUnitLabel: computed(() => getUnitLabel('bit')), |
15 | | - btcUnitLabel: computed(() => getUnitLabel('btc')), |
16 | | - usdFiatLabel: computed(() => FIATS['usd'].displayLong), |
17 | | - eurFiatLabel: computed(() => FIATS['eur'].displayLong), |
18 | | - gbpFiatLabel: computed(() => FIATS['gbp'].displayLong), |
| 11 | + get selectedUnitLabel() { |
| 12 | + return getUnitLabel(store.settings.unit); |
| 13 | + }, |
| 14 | + get selectedFiatLabel() { |
| 15 | + return FIATS[store.settings.fiat].displayLong; |
| 16 | + }, |
| 17 | + get satUnitLabel() { |
| 18 | + return getUnitLabel('sat'); |
| 19 | + }, |
| 20 | + get bitUnitLabel() { |
| 21 | + return getUnitLabel('bit'); |
| 22 | + }, |
| 23 | + get btcUnitLabel() { |
| 24 | + return getUnitLabel('btc'); |
| 25 | + }, |
| 26 | + get usdFiatLabel() { |
| 27 | + return FIATS['usd'].displayLong; |
| 28 | + }, |
| 29 | + get eurFiatLabel() { |
| 30 | + return FIATS['eur'].displayLong; |
| 31 | + }, |
| 32 | + get gbpFiatLabel() { |
| 33 | + return FIATS['gbp'].displayLong; |
| 34 | + }, |
19 | 35 | }); |
20 | 36 | }; |
21 | 37 |
|
|
0 commit comments