diff --git a/src/reducers/subscribe.js b/src/reducers/subscribe.js
index 09e6194..97fc85f 100644
--- a/src/reducers/subscribe.js
+++ b/src/reducers/subscribe.js
@@ -11,8 +11,10 @@ export default function subscribe(state = [], action) {
const { ids } = action;
return state.filter(sub => ids.indexOf(sub.id) === -1);
}
- case RESOURCES_REMOVED:
+ case RESOURCES_REMOVED: {
+ const { ids } = action;
return state.filter(sub => ids.indexOf(sub.id) === -1);
+ }
}
return state;
}
diff --git a/src/socket.js b/src/socket.js
index b961c46..261c326 100644
--- a/src/socket.js
+++ b/src/socket.js
@@ -29,7 +29,8 @@ export default function ws_send(type, body, callback = null) {
const handlers = {
RESOURCES_EXTANT: msg => dispatch(subscribe(...msg.ids)),
- UPDATE_RESOURCES: msg => dispatch(msg)
+ UPDATE_RESOURCES: msg => dispatch(msg),
+ RESOURCES_REMOVED: msg => dispatch(msg),
};
function ws_recv(e) {
diff --git a/src/ui/torrent_details.js b/src/ui/torrent_details.js
index 980042c..27a059c 100644
--- a/src/ui/torrent_details.js
+++ b/src/ui/torrent_details.js
@@ -13,7 +13,12 @@ import {
Progress
} from 'reactstrap';
import ws_send from '../socket';
-import selectTorrent, { EXCLUSIVE, UNION, NONE } from '../actions/selection';
+import selectTorrent, {
+ EXCLUSIVE,
+ UNION,
+ SUBTRACT,
+ NONE
+} from '../actions/selection';
function File({ file }) {
// TODO: show progress bar
@@ -64,7 +69,7 @@ class Torrent extends Component {
}
render() {
- const { torrent, files } = this.props;
+ const { dispatch, torrent, files } = this.props;
const status = s => s[0].toUpperCase() + s.slice(1);
if (!torrent || !files) {
@@ -100,7 +105,12 @@ class Torrent extends Component {
Remove