Skip to content
This repository was archived by the owner on Feb 23, 2021. It is now read-only.

Commit b12a049

Browse files
committed
Port ComputedWallet to mobx 4
1 parent 0b68198 commit b12a049

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

src/computed/wallet.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,30 @@
22
* @fileOverview computed values that are used in wallet UI components.
33
*/
44

5-
import { computed, extendObservable } from 'mobx';
5+
import { extendObservable } from 'mobx';
66
import { toAmountLabel } from '../helper';
77
import { UNITS, FIATS } from '../config';
88

99
const ComputedWallet = store => {
1010
extendObservable(store, {
11-
walletAddressUri: computed(
12-
() => (store.walletAddress ? `bitcoin:${store.walletAddress}` : '')
13-
),
14-
depositLabel: computed(() => {
11+
get walletAddressUri() {
12+
return store.walletAddress ? `bitcoin:${store.walletAddress}` : '';
13+
},
14+
get depositLabel() {
1515
const { balanceSatoshis, pendingBalanceSatoshis, settings } = store;
1616
return toAmountLabel(balanceSatoshis + pendingBalanceSatoshis, settings);
17-
}),
18-
channelBalanceLabel: computed(() =>
19-
toAmountLabel(store.channelBalanceSatoshis, store.settings)
20-
),
21-
unitFiatLabel: computed(() => {
17+
},
18+
get channelBalanceLabel() {
19+
return toAmountLabel(store.channelBalanceSatoshis, store.settings);
20+
},
21+
get unitFiatLabel() {
2222
const { displayFiat, unit, fiat } = store.settings;
2323
return displayFiat ? FIATS[fiat].display : UNITS[unit].display;
24-
}),
25-
unitLabel: computed(() => {
24+
},
25+
get unitLabel() {
2626
const { settings } = store;
2727
return !settings.displayFiat ? UNITS[settings.unit].display : null;
28-
}),
28+
},
2929
});
3030
};
3131

0 commit comments

Comments
 (0)