diff --git a/src/short-urls/ShortUrlsList.js b/src/short-urls/ShortUrlsList.js
index 3a4f3d19..e4907a67 100644
--- a/src/short-urls/ShortUrlsList.js
+++ b/src/short-urls/ShortUrlsList.js
@@ -1,6 +1,7 @@
import React from 'react';
import { connect } from 'react-redux';
import { listShortUrls } from './reducers/shortUrlsList';
+import { isEmpty } from 'ramda';
export class ShortUrlsList extends React.Component {
componentDidMount() {
@@ -18,8 +19,8 @@ export class ShortUrlsList extends React.Component {
renderShortUrls() {
const { shortUrlsList } = this.props;
- if (! shortUrlsList) {
- return '
Loading...';
+ if (isEmpty(shortUrlsList)) {
+ return Loading...;
}
return shortUrlsList.map(shortUrl => (
diff --git a/src/short-urls/reducers/shortUrlsList.js b/src/short-urls/reducers/shortUrlsList.js
index 71bbbc36..f739b0b6 100644
--- a/src/short-urls/reducers/shortUrlsList.js
+++ b/src/short-urls/reducers/shortUrlsList.js
@@ -16,6 +16,7 @@ export const listShortUrls = (serverId) => {
const selectedServer = ServersService.findServerById(serverId);
ShlinkApiClient.setConfig(selectedServer);
- dispatch({ type: LIST_SHORT_URLS, shortUrls: await ShlinkApiClient.listShortUrls() });
+ const shortUrls = await ShlinkApiClient.listShortUrls();
+ dispatch({ type: LIST_SHORT_URLS, shortUrls });
};
};