diff options
author | Florian Dold <florian.dold@gmail.com> | 2016-10-19 23:27:46 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2016-10-19 23:27:46 +0200 |
commit | 9fbf208aab2f29687e7971b9882779f846e3e1d4 (patch) | |
tree | 3771c57f00838f5a6b51cb7fe5c2534b600f5022 /pages | |
parent | 6a11b512b3b0b528bf51fe55861a9cffa0325e19 (diff) |
spacing
Diffstat (limited to 'pages')
-rw-r--r-- | pages/confirm-contract.tsx | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/pages/confirm-contract.tsx b/pages/confirm-contract.tsx index 5867051ac..91f4c2e82 100644 --- a/pages/confirm-contract.tsx +++ b/pages/confirm-contract.tsx @@ -44,20 +44,28 @@ interface DetailProps { class Details extends preact.Component<DetailProps, DetailState> { constructor(props: DetailProps) { super(props); - this.state = { + this.setState({ collapsed: props.collapsed, exchanges: null - }; + }); + + console.log("initial state:", this.state); this.update(); } + componentWillReceiveProps(props: DetailProps) { + this.setState({collapsed: props.collapsed} as any); + } + async update() { let exchanges = await getExchanges(); this.setState({exchanges} as any); } render(props: DetailProps, state: DetailState) { + console.log("details collapsed (state)", state.collapsed); + console.log("details collapsed (prop)", props.collapsed); if (state.collapsed) { return ( <div> @@ -141,7 +149,7 @@ class ContractPrompt extends preact.Component<ContractPromptProps, ContractPromp this.state.payDisabled = false; this.state.error = null; } - this.forceUpdate(); + this.setState({} as any); window.setTimeout(() => this.checkPayment(), 300); }); } |