Fix movements ui when erroring.

This commit is contained in:
sfigato 2019-08-08 15:30:13 +02:00 committed by blallo
parent 969e0b1ae7
commit a369c4978d
Signed by: blallo
GPG Key ID: 0CBE577C9B72DC3F

View File

@ -26,14 +26,16 @@ class MovementsPage extends React.Component {
handleTable() { handleTable() {
if (this.state.movements !== undefined) { if (this.state.movements !== undefined) {
return <ul>{this.state.movements.map(movs => <li key={movs.time}>{movs.time}&nbsp; - &nbsp;{movs.type}</li>)}</ul>; const table =
<ul>{this.state.movements.map(movs => <li key={movs.time}>{movs.time}&nbsp; - &nbsp;{movs.type}</li>)}</ul>;
return <ModalBox title="Movements" data={table} />;
} else { } else {
return Empty; return Empty;
} }
} }
render() { render() {
const movements = <ModalBox title="Movements" data={this.handleTable()} />; const movements = this.handleTable();
if (this.state.error) { if (this.state.error) {
return Error; return Error;