From 9fbf208aab2f29687e7971b9882779f846e3e1d4 Mon Sep 17 00:00:00 2001
From: Florian Dold <florian.dold@gmail.com>
Date: Wed, 19 Oct 2016 23:27:46 +0200
Subject: spacing

---
 pages/confirm-contract.tsx | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

(limited to 'pages/confirm-contract.tsx')

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);
     });
   }
-- 
cgit v1.2.3

