wait until lists retrieved from api before redirecting on 'invalid' list url

This commit is contained in:
Collin M. Barrett 2019-08-26 12:53:02 -05:00
parent 2019624267
commit 2b8ae9f9e2

View file

@ -141,7 +141,7 @@ export class ListsTable extends React.Component<RouteComponentProps, State> {
const list = this.state.lists.find(l => l.id === +props.match.params.id);
return list
? <ListDetailsDrawer list={list as List} {...props} {...this.state} />
: <Redirect to={{ pathname: "/", }} />
: this.state.lists && this.state.lists.length && <Redirect to={{ pathname: "/", }} />
}} />
</span>
);