diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-05-29 16:27:53 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-05-29 16:27:53 +0200 |
commit | 1c3346cd534143f4dd56a625b963a1a3acfa83d1 (patch) | |
tree | e7c3571e63e35f745571b606e1d0db9bc80f6675 /src/webex/pages/payback.tsx | |
parent | d0e0c6baf274aab378233a7ae0d67307c03b3a7c (diff) | |
download | wallet-core-1c3346cd534143f4dd56a625b963a1a3acfa83d1.tar.xz |
less ad-hoc messaging, fix some lint warnings
Diffstat (limited to 'src/webex/pages/payback.tsx')
-rw-r--r-- | src/webex/pages/payback.tsx | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/src/webex/pages/payback.tsx b/src/webex/pages/payback.tsx index 7bcc581d8..e10da7b05 100644 --- a/src/webex/pages/payback.tsx +++ b/src/webex/pages/payback.tsx @@ -21,25 +21,28 @@ */ +/** + * Imports. + */ import { amountToPretty, getTalerStampDate } from "../../helpers"; import { - ExchangeRecord, - ExchangeForCurrencyRecord, - DenominationRecord, AuditorRecord, - CurrencyRecord, - ReserveRecord, CoinRecord, - PreCoinRecord, + CurrencyRecord, Denomination, + DenominationRecord, + ExchangeForCurrencyRecord, + ExchangeRecord, + PreCoinRecord, + ReserveRecord, WalletBalance, } from "../../types"; import { ImplicitStateComponent, StateHolder } from "../components"; import { getCurrencies, - updateCurrency, getPaybackReserves, + updateCurrency, withdrawPaybackReserve, } from "../wxApi"; @@ -47,10 +50,10 @@ import * as React from "react"; import * as ReactDOM from "react-dom"; class Payback extends ImplicitStateComponent<any> { - reserves: StateHolder<ReserveRecord[]|null> = this.makeState(null); + private reserves: StateHolder<ReserveRecord[]|null> = this.makeState(null); constructor() { super(); - let port = chrome.runtime.connect(); + const port = chrome.runtime.connect(); port.onMessage.addListener((msg: any) => { if (msg.notify) { console.log("got notified"); @@ -61,25 +64,25 @@ class Payback extends ImplicitStateComponent<any> { } async update() { - let reserves = await getPaybackReserves(); + const reserves = await getPaybackReserves(); this.reserves(reserves); } withdrawPayback(pub: string) { - withdrawPaybackReserve(pub); + withdrawPaybackReserve(pub); } render(): JSX.Element { - let reserves = this.reserves(); + const reserves = this.reserves(); if (!reserves) { return <span>loading ...</span>; } - if (reserves.length == 0) { + if (reserves.length === 0) { return <span>No reserves with payback available.</span>; } return ( <div> - {reserves.map(r => ( + {reserves.map((r) => ( <div> <h2>Reserve for ${amountToPretty(r.current_amount!)}</h2> <ul> @@ -93,7 +96,7 @@ class Payback extends ImplicitStateComponent<any> { } } -export function main() { +function main() { ReactDOM.render(<Payback />, document.getElementById("container")!); } |