diff --git a/src/actions/selection.js b/src/actions/selection.js index 65766ee..436e9ab 100644 --- a/src/actions/selection.js +++ b/src/actions/selection.js @@ -6,7 +6,7 @@ export const UNION = 'UNION'; export const SUBTRACT = 'SUBTRACT'; export const EXCLUSIVE = 'EXCLUSIVE'; -export default function selectTorrent(ids, action) { +export default function selectTorrent(ids, action, navigate=true) { return (dispatch, getState) => { const previous = new Set(getState().selection); dispatch({ type: action, ids }); @@ -56,11 +56,13 @@ export default function selectTorrent(ids, action) { } }); - const url_torrents = state.selection.slice(0, 3); - if (url_torrents.length > 0) { - dispatch(push(`/torrents/${url_torrents}`)); - } else { - dispatch(push("/")); + if (navigate) { + const url_torrents = state.selection.slice(0, 3); + if (url_torrents.length > 0) { + dispatch(push(`/torrents/${url_torrents}`)); + } else { + dispatch(push("/")); + } } }; } diff --git a/src/ui/torrent_details.js b/src/ui/torrent_details.js index 5b48ece..085e664 100644 --- a/src/ui/torrent_details.js +++ b/src/ui/torrent_details.js @@ -158,7 +158,7 @@ class TorrentDetails extends Component { componentWillUnmount() { const { dispatch } = this.props; - dispatch(selectTorrent([], EXCLUSIVE)); + dispatch(selectTorrent([], EXCLUSIVE, false)); } renderHeader(selection) {