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 &&
|
!missingDependencies &&
|
||||||
!this.props.InstallActive;
|
!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] &&
|
const remoteSupported = this.props.LocationsLookup[selectedVersion] &&
|
||||||
this.props.LocationsLookup[selectedVersion].supports_remote;
|
this.props.LocationsLookup[selectedVersion].supports_remote;
|
||||||
|
|
||||||
const showConfig = !missingDependencies &&
|
const showConfig = !missingDependencies &&
|
||||||
this.props.DisplayConfiguration &&
|
this.props.DisplayConfiguration &&
|
||||||
!this.props.RebootRequired &&
|
!this.props.RebootRequired;
|
||||||
allowConfig;
|
|
||||||
|
|
||||||
const showUpgrade = this.props.UpgradeAvailable &&
|
const showUpgrade = this.props.UpgradeAvailable &&
|
||||||
!this.props.DisplayError &&
|
!this.props.DisplayError &&
|
||||||
@@ -152,10 +142,7 @@ class App extends IPCContainer {
|
|||||||
mainContent.push((
|
mainContent.push((
|
||||||
<Box dxStyle={{padding: 'var(--default_spacing)', height: 'auto'}}
|
<Box dxStyle={{padding: 'var(--default_spacing)', height: 'auto'}}
|
||||||
key={'md_' + key++}>
|
key={'md_' + key++}>
|
||||||
<MountItems allowConfig={allowConfig}
|
<MountItems remoteSupported={remoteSupported}/>
|
||||||
allowSiaPrime={allowSiaPrime}
|
|
||||||
noConsoleSupported={noConsoleSupported}
|
|
||||||
remoteSupported={remoteSupported}/>
|
|
||||||
</Box>
|
</Box>
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,25 +46,22 @@ export default connect(mapStateToProps, mapDispatchToProps)(props => {
|
|||||||
props.setProviderState(props.provider, state);
|
props.setProviderState(props.provider, state);
|
||||||
};
|
};
|
||||||
|
|
||||||
let configButton = null;
|
|
||||||
let secondRow = 6;
|
let secondRow = 6;
|
||||||
if (props.allowConfig) {
|
const pointer = {cursor: props.MState.AllowMount ? 'pointer' : 'no-drop'};
|
||||||
const pointer = {cursor: props.MState.AllowMount ? 'pointer' : 'no-drop'};
|
const configButton = (
|
||||||
configButton = (
|
<RootElem colSpan={4}
|
||||||
<RootElem colSpan={4}
|
rowSpan={6}>
|
||||||
rowSpan={6}>
|
<img alt=''
|
||||||
<img alt=''
|
height={'16px'}
|
||||||
height={'16px'}
|
onClick={props.MState.AllowMount ? ()=>props.displayConfiguration(props.provider, props.remote) : e=>{e.preventDefault();}}
|
||||||
onClick={props.MState.AllowMount ? ()=>props.displayConfiguration(props.provider, props.remote) : e=>{e.preventDefault();}}
|
src={configureImage}
|
||||||
src={configureImage}
|
style={{padding: 0, border: 0, margin: 0, ...pointer}}
|
||||||
style={{padding: 0, border: 0, margin: 0, ...pointer}}
|
width={'16px'}/>
|
||||||
width={'16px'}/>
|
</RootElem>
|
||||||
</RootElem>
|
);
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
let inputColumnSpan;
|
let inputColumnSpan;
|
||||||
let inputControls = null;
|
let inputControls;
|
||||||
if (props.Platform === 'win32') {
|
if (props.Platform === 'win32') {
|
||||||
inputColumnSpan = 20;
|
inputColumnSpan = 20;
|
||||||
const index = props.MState.DriveLetters.indexOf(props.PState.MountLocation);
|
const index = props.MState.DriveLetters.indexOf(props.PState.MountLocation);
|
||||||
|
|||||||
@@ -203,7 +203,6 @@ class MountItems extends IPCContainer {
|
|||||||
if (mount) {
|
if (mount) {
|
||||||
this.sendRequest(Constants.IPC_Mount_Drive, {
|
this.sendRequest(Constants.IPC_Mount_Drive, {
|
||||||
Location: location,
|
Location: location,
|
||||||
NoConsoleSupported: this.props.noConsoleSupported,
|
|
||||||
Provider: provider,
|
Provider: provider,
|
||||||
Remote: remote,
|
Remote: remote,
|
||||||
Version: this.props.InstalledVersion,
|
Version: this.props.InstalledVersion,
|
||||||
@@ -344,8 +343,7 @@ class MountItems extends IPCContainer {
|
|||||||
let items = [];
|
let items = [];
|
||||||
for (const provider of Constants.PROVIDER_LIST) {
|
for (const provider of Constants.PROVIDER_LIST) {
|
||||||
items.push((
|
items.push((
|
||||||
<MountItem allowConfig={this.props.allowConfig}
|
<MountItem allowRemove={false}
|
||||||
allowRemove={false}
|
|
||||||
browseClicked={this.handleBrowseLocation}
|
browseClicked={this.handleBrowseLocation}
|
||||||
changed={e => this.handleMountLocationChanged(provider, e.target.value)}
|
changed={e => this.handleMountLocationChanged(provider, e.target.value)}
|
||||||
clicked={this.handleMountUnMount}
|
clicked={this.handleMountUnMount}
|
||||||
@@ -359,8 +357,7 @@ class MountItems extends IPCContainer {
|
|||||||
if (this.props.remoteSupported) {
|
if (this.props.remoteSupported) {
|
||||||
for (const provider of this.props.RemoteMounts) {
|
for (const provider of this.props.RemoteMounts) {
|
||||||
items.push((
|
items.push((
|
||||||
<MountItem allowConfig={this.props.allowConfig}
|
<MountItem allowRemove={true}
|
||||||
allowRemove={true}
|
|
||||||
browseClicked={this.handleBrowseLocation}
|
browseClicked={this.handleBrowseLocation}
|
||||||
changed={e => this.handleMountLocationChanged(provider, e.target.value)}
|
changed={e => this.handleMountLocationChanged(provider, e.target.value)}
|
||||||
clicked={this.handleMountUnMount}
|
clicked={this.handleMountUnMount}
|
||||||
|
|||||||
@@ -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) => {
|
return new Promise((resolve) => {
|
||||||
const repertoryExec = _getRepertoryExec(version);
|
const repertoryExec = _getRepertoryExec(version);
|
||||||
const processOptions = {
|
const processOptions = {
|
||||||
@@ -424,9 +424,7 @@ module.exports.executeMount = (version, provider, remote, location, noConsoleSup
|
|||||||
args.push('-o');
|
args.push('-o');
|
||||||
args.push('big_writes');
|
args.push('big_writes');
|
||||||
args.push('-f');
|
args.push('-f');
|
||||||
if (noConsoleSupported) {
|
args.push('-nc');
|
||||||
args.push('-nc');
|
|
||||||
}
|
|
||||||
} else if (os.platform() === 'win32') {
|
} else if (os.platform() === 'win32') {
|
||||||
args.push('-hidden');
|
args.push('-hidden');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -222,7 +222,7 @@ const addListeners = (ipcMain, setTrayImage, standardIPCReply) => {
|
|||||||
}, error || Error(data.Provider + ' Unmounted'));
|
}, error || Error(data.Provider + ' Unmounted'));
|
||||||
};
|
};
|
||||||
helpers
|
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);
|
errorHandler(pid, error);
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user