Handle empty torrent list response

This commit is contained in:
John Furrow
2016-06-02 21:06:37 -07:00
parent ced4685163
commit 2d6d696bf4
8 changed files with 73 additions and 10 deletions
+8 -2
View File
@@ -178,15 +178,21 @@ class TorrentStoreClass extends BaseStore {
}
handleFetchTorrentsError(error) {
console.log(error);
console.trace(error);
}
handleFetchTorrentsSuccess(torrents) {
this.resolveRequest('fetch-torrents');
if (torrents == null) {
this.emit(EventTypes.CLIENT_TORRENTS_EMPTY);
return;
}
this.sortTorrents(torrents);
this.filterTorrents();
this.emit(EventTypes.CLIENT_TORRENTS_REQUEST_SUCCESS);
this.resolveRequest('fetch-torrents');
}
handleRemoveTorrentsSuccess(response) {