Fix the torrent count if there's no torrent data

This commit is contained in:
Grégoire Delattre 2020-04-16 11:03:41 +02:00
parent 1cc826e97a
commit 99e74356e6

View File

@ -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":