Moved logic to mark selected server to parent component in order to affect all children compo0nents on the same route

This commit is contained in:
Alejandro Celaya
2018-07-24 19:17:01 +02:00
parent 3eaa66435a
commit 78ba7c75ff
6 changed files with 72 additions and 41 deletions

View File

@@ -102,7 +102,11 @@ export class ShortUrlsList extends React.Component {
}
renderShortUrls() {
const { shortUrlsList, selectedServer, loading } = this.props;
const { shortUrlsList, selectedServer, loading, error } = this.props;
if (error) {
return <tr><td colSpan="6" className="text-center table-danger">Something went wrong while loading short URLs :(</td></tr>;
}
if (loading) {
return <tr><td colSpan="6" className="text-center">Loading...</td></tr>;
}