This commit is contained in:
Florian Dold 2016-10-19 23:27:46 +02:00
parent 6a11b512b3
commit 9fbf208aab
2 changed files with 13 additions and 4 deletions

View File

@ -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);
});
}

View File

@ -217,7 +217,8 @@ class WalletBalanceView extends preact.Component<any, any> {
help
</ExtensionLink>
);
return <div>You have no balance to show. Need some {helpLink}
return <div>You have no balance to show. Need some
{" "}{helpLink}{" "}
getting started?</div>;
}