diff --git a/src/public/js/actions/torrents.js b/src/public/js/actions/torrents.js index f6c7f0b..8af86d0 100644 --- a/src/public/js/actions/torrents.js +++ b/src/public/js/actions/torrents.js @@ -19,7 +19,7 @@ export function removeTorrent(id) { "REMOVE_TORRENT", configureAxios().delete(`/torrents/${id}`), [ - fetchTorrents(), + () => fetchTorrents(), ] ) } diff --git a/src/public/js/components/torrents/list.js b/src/public/js/components/torrents/list.js index 42e6ed1..856edbc 100644 --- a/src/public/js/components/torrents/list.js +++ b/src/public/js/components/torrents/list.js @@ -3,8 +3,6 @@ import { connect } from "react-redux" import { bindActionCreators } from "redux" import { addTorrent, removeTorrent } from "../../actions/torrents" -import { OverlayTrigger, Tooltip } from "react-bootstrap" - function mapStateToProps(state) { return { torrents: state.torrentStore.get("torrents") }; } @@ -116,7 +114,6 @@ class Torrent extends React.PureComponent { this.props.removeTorrent(this.props.data.getIn(["additional_infos", "id"])); } render() { - const id = this.props.data.getIn(["additional_infos", "id"]); const done = this.props.data.get("is_finished"); var progressStyle = "progress-bar progress-bar-info active"; if (done) { @@ -128,8 +125,6 @@ class Torrent extends React.PureComponent { percentDone = Number(percentDone).toFixed(1) + "%"; } - const tooltip = (Remove this torrent); - // Pretty sizes const downloadedSize = prettySize(this.props.data.get("downloaded_size")); const totalSize = prettySize(this.props.data.get("total_size")); @@ -138,11 +133,7 @@ class Torrent extends React.PureComponent {
{this.props.data.get("name")} - - - - - +
{started && diff --git a/src/public/js/requests.js b/src/public/js/requests.js index c47221f..0b6a8db 100644 --- a/src/public/js/requests.js +++ b/src/public/js/requests.js @@ -30,12 +30,12 @@ export function request(eventPrefix, promise, callbackEvents = null, mainPayload }) promise .then(response => { - if (response.data.status === "error") + if (response.status === "error") { dispatch({ type: "ADD_ALERT_ERROR", payload: { - message: response.data.message, + message: response.message, main: mainPayload, } }); @@ -50,7 +50,7 @@ export function request(eventPrefix, promise, callbackEvents = null, mainPayload }) if (callbackEvents) { for (let event of callbackEvents) { - if (typeof event === 'function') { + if (typeof event === "function") { event = event(); } dispatch(event);