From 1cd108702c68e1e49ac7581a12a1442d046a45a4 Mon Sep 17 00:00:00 2001 From: John Furrow Date: Sun, 20 Mar 2016 18:19:12 +0100 Subject: [PATCH] Fix torrent storing & livereload --- client/source/scripts/stores/TorrentStore.js | 10 ++++++++-- package.json | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/client/source/scripts/stores/TorrentStore.js b/client/source/scripts/stores/TorrentStore.js index 541b1abe..0e6a711a 100644 --- a/client/source/scripts/stores/TorrentStore.js +++ b/client/source/scripts/stores/TorrentStore.js @@ -174,8 +174,7 @@ class TorrentStoreClass extends BaseStore { startPollingTorrents() { this.pollTorrentsIntervalID = setInterval( - this.fetchTorrents.bind(this), - config.pollInterval + this.fetchTorrents.bind(this), config.pollInterval ); } @@ -191,6 +190,11 @@ class TorrentStoreClass extends BaseStore { triggerTorrentsFilter() { this.filterTorrents(); + this.emit(EventTypes.CLIENT_TORRENTS_REQUEST_SUCCESS); + } + + triggerTorrentsSort() { + this.sortTorrents(this.torrents); } } @@ -224,6 +228,8 @@ TorrentStore.dispatcherID = AppDispatcher.register((payload) => { case ActionTypes.UI_CLICK_TORRENT: TorrentStore.setSelectedTorrents(action.data.event, action.data.hash); break; + case ActionTypes.UI_SET_TORRENT_SORT: + TorrentStore.triggerTorrentsSort(); case ActionTypes.UI_SET_TORRENT_STATUS_FILTER: case ActionTypes.UI_SET_TORRENT_TRACKER_FILTER: case ActionTypes.UI_SET_TORRENT_SEARCH_FILTER: diff --git a/package.json b/package.json index 1c57964b..6ffe71b4 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "0.0.0", "private": true, "scripts": { - "livereload": "NODE_ENV='development' && ./node_modules/.bin/gulp livereload", + "livereload": "NODE_ENV='development' ./node_modules/.bin/gulp livereload", "start": "npm prune && npm install && ./node_modules/.bin/gulp dist && nodemon ./server/bin/www" }, "dependencies": {