From ebbdadb4b6bd59e57b0eec8e280c7c5c12453167 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Wed, 14 Sep 2016 15:55:10 +0200 Subject: sort out libs / fix warnings --- pages/confirm-contract.tsx | 2 +- pages/confirm-create-reserve.tsx | 6 +++--- pages/show-db.ts | 6 +++++- 3 files changed, 9 insertions(+), 5 deletions(-) (limited to 'pages') diff --git a/pages/confirm-contract.tsx b/pages/confirm-contract.tsx index e88336a2d..19b049eb5 100644 --- a/pages/confirm-contract.tsx +++ b/pages/confirm-contract.tsx @@ -95,7 +95,7 @@ export function main() { } }; - m.mount(document.getElementById("contract"), Contract); + m.mount(document.getElementById("contract")!, Contract); function checkPayment() { chrome.runtime.sendMessage({type: 'check-pay', detail: {offer}}, (resp) => { diff --git a/pages/confirm-create-reserve.tsx b/pages/confirm-create-reserve.tsx index 667323044..0a509118d 100644 --- a/pages/confirm-create-reserve.tsx +++ b/pages/confirm-create-reserve.tsx @@ -189,7 +189,7 @@ class Controller { } function view(ctrl: Controller): any { - function* f() { + function* f(): IterableIterator { yield m("p", i18n.parts`You are about to withdraw ${m("strong", amountToPretty( ctrl.amount))} from your bank account into your wallet.`); @@ -374,8 +374,8 @@ export function main() { getSuggestedExchange(amount.currency) .then((suggestedExchangeUrl) => { const controller = function () { return new Controller(suggestedExchangeUrl, amount, callback_url, wt_types); }; - var ExchangeSelection = {controller, view}; - m.mount(document.getElementById("exchange-selection"), ExchangeSelection); + const ExchangeSelection = {controller, view}; + m.mount(document.getElementById("exchange-selection")!, ExchangeSelection); }) .catch((e) => { // TODO: provide more context information, maybe factor it out into a diff --git a/pages/show-db.ts b/pages/show-db.ts index 0a3a5bd46..71e74388b 100644 --- a/pages/show-db.ts +++ b/pages/show-db.ts @@ -48,6 +48,10 @@ function prettyPrint(obj: any) { document.addEventListener("DOMContentLoaded", () => { chrome.runtime.sendMessage({type: 'dump-db'}, (resp) => { - document.getElementById('dump').innerHTML = prettyPrint(resp); + const el = document.getElementById('dump'); + if (!el) { + throw Error(); + } + el.innerHTML = prettyPrint(resp); }); }); -- cgit v1.2.3