From efc85c1759f7168a9f69fc213229ef93b30f066b Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Thu, 13 Feb 2020 14:08:11 -0600 Subject: [PATCH] Remove unused code --- src/App.js | 17 ++-------- .../MountItems/MountItem/MountItem.js | 31 +++++++++---------- src/containers/MountItems/MountItems.js | 11 +++---- src/helpers.js | 6 ++-- src/renderer/ipc/MountsIPC.js | 4 +-- 5 files changed, 24 insertions(+), 45 deletions(-) diff --git a/src/App.js b/src/App.js index 1c90f12..e2cdd81 100644 --- a/src/App.js +++ b/src/App.js @@ -89,22 +89,12 @@ class App extends IPCContainer { !missingDependencies && !this.props.InstallActive; - const allowConfig = this.props.LocationsLookup[selectedVersion] && - this.props.LocationsLookup[selectedVersion].config_support; - - const allowSiaPrime = this.props.LocationsLookup[selectedVersion] && - this.props.LocationsLookup[selectedVersion].siaprime_support; - - const noConsoleSupported = this.props.LocationsLookup[selectedVersion] && - this.props.LocationsLookup[selectedVersion].no_console_supported; - const remoteSupported = this.props.LocationsLookup[selectedVersion] && this.props.LocationsLookup[selectedVersion].supports_remote; const showConfig = !missingDependencies && this.props.DisplayConfiguration && - !this.props.RebootRequired && - allowConfig; + !this.props.RebootRequired; const showUpgrade = this.props.UpgradeAvailable && !this.props.DisplayError && @@ -152,10 +142,7 @@ class App extends IPCContainer { mainContent.push(( - + )); } diff --git a/src/containers/MountItems/MountItem/MountItem.js b/src/containers/MountItems/MountItem/MountItem.js index b56ae7e..3572b47 100644 --- a/src/containers/MountItems/MountItem/MountItem.js +++ b/src/containers/MountItems/MountItem/MountItem.js @@ -46,25 +46,22 @@ export default connect(mapStateToProps, mapDispatchToProps)(props => { props.setProviderState(props.provider, state); }; - let configButton = null; let secondRow = 6; - if (props.allowConfig) { - const pointer = {cursor: props.MState.AllowMount ? 'pointer' : 'no-drop'}; - configButton = ( - - props.displayConfiguration(props.provider, props.remote) : e=>{e.preventDefault();}} - src={configureImage} - style={{padding: 0, border: 0, margin: 0, ...pointer}} - width={'16px'}/> - - ); - } + const pointer = {cursor: props.MState.AllowMount ? 'pointer' : 'no-drop'}; + const configButton = ( + + props.displayConfiguration(props.provider, props.remote) : e=>{e.preventDefault();}} + src={configureImage} + style={{padding: 0, border: 0, margin: 0, ...pointer}} + width={'16px'}/> + + ); let inputColumnSpan; - let inputControls = null; + let inputControls; if (props.Platform === 'win32') { inputColumnSpan = 20; const index = props.MState.DriveLetters.indexOf(props.PState.MountLocation); @@ -181,4 +178,4 @@ export default connect(mapStateToProps, mapDispatchToProps)(props => { ); -}); \ No newline at end of file +}); diff --git a/src/containers/MountItems/MountItems.js b/src/containers/MountItems/MountItems.js index 9734632..c1d0757 100644 --- a/src/containers/MountItems/MountItems.js +++ b/src/containers/MountItems/MountItems.js @@ -203,7 +203,6 @@ class MountItems extends IPCContainer { if (mount) { this.sendRequest(Constants.IPC_Mount_Drive, { Location: location, - NoConsoleSupported: this.props.noConsoleSupported, Provider: provider, Remote: remote, Version: this.props.InstalledVersion, @@ -344,8 +343,7 @@ class MountItems extends IPCContainer { let items = []; for (const provider of Constants.PROVIDER_LIST) { items.push(( - this.handleMountLocationChanged(provider, e.target.value)} clicked={this.handleMountUnMount} @@ -359,8 +357,7 @@ class MountItems extends IPCContainer { if (this.props.remoteSupported) { for (const provider of this.props.RemoteMounts) { items.push(( - this.handleMountLocationChanged(provider, e.target.value)} clicked={this.handleMountUnMount} @@ -375,7 +372,7 @@ class MountItems extends IPCContainer { } else { items.splice(items.length - 1, 1) } - + return (
{retryDisplay} @@ -413,4 +410,4 @@ const mapDispatchToProps = dispatch => { } }; -export default connect(mapStateToProps, mapDispatchToProps)(MountItems); \ No newline at end of file +export default connect(mapStateToProps, mapDispatchToProps)(MountItems); diff --git a/src/helpers.js b/src/helpers.js index e9d18bd..922edc1 100644 --- a/src/helpers.js +++ b/src/helpers.js @@ -408,7 +408,7 @@ module.exports.executeScript = script => { }); }; -module.exports.executeMount = (version, provider, remote, location, noConsoleSupported, exitCallback) => { +module.exports.executeMount = (version, provider, remote, location, exitCallback) => { return new Promise((resolve) => { const repertoryExec = _getRepertoryExec(version); const processOptions = { @@ -424,9 +424,7 @@ module.exports.executeMount = (version, provider, remote, location, noConsoleSup args.push('-o'); args.push('big_writes'); args.push('-f'); - if (noConsoleSupported) { - args.push('-nc'); - } + args.push('-nc'); } else if (os.platform() === 'win32') { args.push('-hidden'); } diff --git a/src/renderer/ipc/MountsIPC.js b/src/renderer/ipc/MountsIPC.js index 9c789cc..4b6cfe8 100644 --- a/src/renderer/ipc/MountsIPC.js +++ b/src/renderer/ipc/MountsIPC.js @@ -222,7 +222,7 @@ const addListeners = (ipcMain, setTrayImage, standardIPCReply) => { }, error || Error(data.Provider + ' Unmounted')); }; helpers - .executeMount(data.Version, data.Provider, data.Remote, data.Location, data.NoConsoleSupported, (error, pid) => { + .executeMount(data.Version, data.Provider, data.Remote, data.Location, (error, pid) => { errorHandler(pid, error); }) .then(() => { @@ -272,4 +272,4 @@ const addListeners = (ipcMain, setTrayImage, standardIPCReply) => { module.exports = { addListeners, unmountAllDrives -}; \ No newline at end of file +};