Update the torrent state only if new data is provided
This commit is contained in:
parent
33a84f682d
commit
135ddd0c93
@ -48,8 +48,10 @@ export default (state = defaultState, action) =>
|
|||||||
|
|
||||||
case "TORRENTS_FETCH_FULFILLED":
|
case "TORRENTS_FETCH_FULFILLED":
|
||||||
draft.fetching = false;
|
draft.fetching = false;
|
||||||
draft.torrents = formatTorrents(action.payload.response.data);
|
if (action.payload.response.data) {
|
||||||
draft.count = action.payload.response.data.length;
|
draft.torrents = formatTorrents(action.payload.response.data);
|
||||||
|
draft.count = action.payload.response.data.length;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "TORRENTS_SEARCH_PENDING":
|
case "TORRENTS_SEARCH_PENDING":
|
||||||
|
Loading…
x
Reference in New Issue
Block a user