From 99e74356e69997163ecc1b7d7c5f8a82a3c1bf2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Delattre?= Date: Thu, 16 Apr 2020 11:03:41 +0200 Subject: [PATCH] Fix the torrent count if there's no torrent data --- frontend/js/reducers/torrents.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/js/reducers/torrents.js b/frontend/js/reducers/torrents.js index 920ba1b..405a579 100644 --- a/frontend/js/reducers/torrents.js +++ b/frontend/js/reducers/torrents.js @@ -49,7 +49,9 @@ export default (state = defaultState, action) => case "TORRENTS_FETCH_FULFILLED": draft.fetching = false; draft.torrents = formatTorrents(action.payload.response.data); - draft.count = action.payload.response.data.length; + draft.count = action.payload.response.data + ? action.payload.response.data.length + : 0; break; case "TORRENTS_SEARCH_PENDING":