diff --git a/src/renderer/component/fileList/view.jsx b/src/renderer/component/fileList/view.jsx index 9c926e825..7afe8998d 100644 --- a/src/renderer/component/fileList/view.jsx +++ b/src/renderer/component/fileList/view.jsx @@ -13,40 +13,8 @@ class FileList extends React.PureComponent { }; this._sortFunctions = { - dateNew: fileInfos => - this.props.sortByHeight - ? fileInfos.slice().sort((fileInfo1, fileInfo2) => { - const height1 = this.props.claimsById[fileInfo1.claim_id] - ? this.props.claimsById[fileInfo1.claim_id].height - : 0; - const height2 = this.props.claimsById[fileInfo2.claim_id] - ? this.props.claimsById[fileInfo2.claim_id].height - : 0; - if (height1 > height2) { - return -1; - } else if (height1 < height2) { - return 1; - } - return 0; - }) - : [...fileInfos].reverse(), - dateOld: fileInfos => - this.props.sortByHeight - ? fileInfos.slice().sort((fileInfo1, fileInfo2) => { - const height1 = this.props.claimsById[fileInfo1.claim_id] - ? this.props.claimsById[fileInfo1.claim_id].height - : 999999; - const height2 = this.props.claimsById[fileInfo2.claim_id] - ? this.props.claimsById[fileInfo2.claim_id].height - : 999999; - if (height1 < height2) { - return -1; - } else if (height1 > height2) { - return 1; - } - return 0; - }) - : fileInfos, + dateNew: fileInfos => [...fileInfos].reverse(), + dateOld: fileInfos => fileInfos, title: fileInfos => fileInfos.slice().sort((fileInfo1, fileInfo2) => { const title1 = fileInfo1.value diff --git a/src/renderer/modal/modalIncompatibleDaemon/index.js b/src/renderer/modal/modalIncompatibleDaemon/index.js index fda1b57f9..8feed2ca7 100644 --- a/src/renderer/modal/modalIncompatibleDaemon/index.js +++ b/src/renderer/modal/modalIncompatibleDaemon/index.js @@ -1,12 +1,10 @@ -import React from 'react'; import { connect } from 'react-redux'; -import { doQuit, doSkipWrongDaemonNotice } from 'redux/actions/app'; +import { doQuit, doQuitAnyDaemon } from 'redux/actions/app'; import ModalIncompatibleDaemon from './view'; -const select = state => ({}); - const perform = dispatch => ({ quit: () => dispatch(doQuit()), + quitAnyDaemon: () => dispatch(doQuitAnyDaemon()), }); -export default connect(select, perform)(ModalIncompatibleDaemon); +export default connect(null, perform)(ModalIncompatibleDaemon); diff --git a/src/renderer/modal/modalIncompatibleDaemon/view.jsx b/src/renderer/modal/modalIncompatibleDaemon/view.jsx index cfab04ab1..3526ab4e9 100644 --- a/src/renderer/modal/modalIncompatibleDaemon/view.jsx +++ b/src/renderer/modal/modalIncompatibleDaemon/view.jsx @@ -4,15 +4,17 @@ import Link from 'component/link/index'; class ModalIncompatibleDaemon extends React.PureComponent { render() { - const { quit } = this.props; + const { quit, quitAnyDaemon } = this.props; return ( {__( 'This browser is running with an incompatible version of the LBRY protocol and your install must be repaired. ' diff --git a/src/renderer/page/fileListPublished/view.jsx b/src/renderer/page/fileListPublished/view.jsx index e7917f67d..de19dd1dd 100644 --- a/src/renderer/page/fileListPublished/view.jsx +++ b/src/renderer/page/fileListPublished/view.jsx @@ -25,7 +25,6 @@ class FileListPublished extends React.PureComponent { fileInfos={claims} fetching={isFetching} fileTileShowEmpty={FileTile.SHOW_EMPTY_PENDING} - sortByHeight /> ); } else if (isFetching) { diff --git a/src/renderer/redux/actions/app.js b/src/renderer/redux/actions/app.js index 6a1f138ba..f9c868baf 100644 --- a/src/renderer/redux/actions/app.js +++ b/src/renderer/redux/actions/app.js @@ -1,3 +1,4 @@ +import { execSync } from 'child_process'; import isDev from 'electron-is-dev'; import Lbry from 'lbry'; import path from 'path'; @@ -329,6 +330,22 @@ export function doQuit() { }; } +export function doQuitAnyDaemon() { + return dispatch => { + try { + if (process.platform === 'win32') { + execSync('taskkill /im lbrynet-daemon.exe /t /f'); + } else { + execSync('pkill lbrynet-daemon'); + } + } catch (error) { + dispatch(doAlertError(`Quitting daemon failed due to: ${error.message}`)); + } finally { + dispatch(doQuit()); + } + }; +} + export function doChangeVolume(volume) { return dispatch => { dispatch({