Remove unused code
This commit is contained in:
17
src/App.js
17
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((
|
||||
<Box dxStyle={{padding: 'var(--default_spacing)', height: 'auto'}}
|
||||
key={'md_' + key++}>
|
||||
<MountItems allowConfig={allowConfig}
|
||||
allowSiaPrime={allowSiaPrime}
|
||||
noConsoleSupported={noConsoleSupported}
|
||||
remoteSupported={remoteSupported}/>
|
||||
<MountItems remoteSupported={remoteSupported}/>
|
||||
</Box>
|
||||
));
|
||||
}
|
||||
|
||||
@@ -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 = (
|
||||
<RootElem colSpan={4}
|
||||
rowSpan={6}>
|
||||
<img alt=''
|
||||
height={'16px'}
|
||||
onClick={props.MState.AllowMount ? ()=>props.displayConfiguration(props.provider, props.remote) : e=>{e.preventDefault();}}
|
||||
src={configureImage}
|
||||
style={{padding: 0, border: 0, margin: 0, ...pointer}}
|
||||
width={'16px'}/>
|
||||
</RootElem>
|
||||
);
|
||||
}
|
||||
const pointer = {cursor: props.MState.AllowMount ? 'pointer' : 'no-drop'};
|
||||
const configButton = (
|
||||
<RootElem colSpan={4}
|
||||
rowSpan={6}>
|
||||
<img alt=''
|
||||
height={'16px'}
|
||||
onClick={props.MState.AllowMount ? ()=>props.displayConfiguration(props.provider, props.remote) : e=>{e.preventDefault();}}
|
||||
src={configureImage}
|
||||
style={{padding: 0, border: 0, margin: 0, ...pointer}}
|
||||
width={'16px'}/>
|
||||
</RootElem>
|
||||
);
|
||||
|
||||
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 => {
|
||||
</Grid>
|
||||
</div>
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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((
|
||||
<MountItem allowConfig={this.props.allowConfig}
|
||||
allowRemove={false}
|
||||
<MountItem allowRemove={false}
|
||||
browseClicked={this.handleBrowseLocation}
|
||||
changed={e => 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((
|
||||
<MountItem allowConfig={this.props.allowConfig}
|
||||
allowRemove={true}
|
||||
<MountItem allowRemove={true}
|
||||
browseClicked={this.handleBrowseLocation}
|
||||
changed={e => 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 (
|
||||
<div style={{margin: 0, padding: 0}}>
|
||||
{retryDisplay}
|
||||
@@ -413,4 +410,4 @@ const mapDispatchToProps = dispatch => {
|
||||
}
|
||||
};
|
||||
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(MountItems);
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(MountItems);
|
||||
|
||||
@@ -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');
|
||||
}
|
||||
|
||||
@@ -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
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user