Update prettier/eslint
This commit is contained in:
@@ -59,18 +59,9 @@ class MountItems extends IPCContainer {
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
this.setRequestHandler(
|
||||
Constants.IPC_Detect_Mount_Reply,
|
||||
this.onDetectMountReply
|
||||
);
|
||||
this.setRequestHandler(
|
||||
Constants.IPC_Mount_Drive_Reply,
|
||||
this.onMountDriveReply
|
||||
);
|
||||
this.setRequestHandler(
|
||||
Constants.IPC_Unmount_Drive_Reply,
|
||||
this.onUnmountDriveReply
|
||||
);
|
||||
this.setRequestHandler(Constants.IPC_Detect_Mount_Reply, this.onDetectMountReply);
|
||||
this.setRequestHandler(Constants.IPC_Mount_Drive_Reply, this.onMountDriveReply);
|
||||
this.setRequestHandler(Constants.IPC_Unmount_Drive_Reply, this.onUnmountDriveReply);
|
||||
this.props.resetMountsState();
|
||||
this.detectMounts();
|
||||
}
|
||||
@@ -136,13 +127,7 @@ class MountItems extends IPCContainer {
|
||||
const retrySeconds = retryItems[provider].RetrySeconds - 1;
|
||||
if (retrySeconds === 0) {
|
||||
this.cancelRetryMount(provider, () => {
|
||||
this.handleMountUnMount(
|
||||
provider,
|
||||
remote,
|
||||
s3,
|
||||
true,
|
||||
mountLocation
|
||||
);
|
||||
this.handleMountUnMount(provider, remote, s3, true, mountLocation);
|
||||
});
|
||||
} else {
|
||||
retryItems[provider].RetrySeconds = retrySeconds;
|
||||
@@ -192,12 +177,9 @@ class MountItems extends IPCContainer {
|
||||
if (result.Success) {
|
||||
if (result.Valid) {
|
||||
if (this.props.Platform !== 'win32') {
|
||||
result = this.sendSyncRequest(
|
||||
Constants.IPC_Check_Mount_Location,
|
||||
{
|
||||
Location: location,
|
||||
}
|
||||
);
|
||||
result = this.sendSyncRequest(Constants.IPC_Check_Mount_Location, {
|
||||
Location: location,
|
||||
});
|
||||
if (!result.Success) {
|
||||
allowAction = false;
|
||||
this.props.notifyError(result.Error.toString());
|
||||
@@ -225,11 +207,7 @@ class MountItems extends IPCContainer {
|
||||
remote,
|
||||
s3,
|
||||
location,
|
||||
'Incompatible ' +
|
||||
provider +
|
||||
' daemon. Please upgrade ' +
|
||||
provider +
|
||||
'.'
|
||||
'Incompatible ' + provider + ' daemon. Please upgrade ' + provider + '.'
|
||||
);
|
||||
} else {
|
||||
this.displayRetryMount(
|
||||
@@ -319,8 +297,7 @@ class MountItems extends IPCContainer {
|
||||
if (!this.state.RetryItems[provider]) {
|
||||
if (
|
||||
arg.data.Success &&
|
||||
(!arg.data.Active ||
|
||||
(arg.data.Location && arg.data.Location.length > 0))
|
||||
(!arg.data.Active || (arg.data.Location && arg.data.Location.length > 0))
|
||||
) {
|
||||
const mountState = {
|
||||
AllowMount: true,
|
||||
@@ -358,11 +335,7 @@ class MountItems extends IPCContainer {
|
||||
arg.data.Location &&
|
||||
this.props.ProviderState[arg.data.Provider].AutoRestart
|
||||
) {
|
||||
this.displayRetryMount(
|
||||
arg.data.Provider,
|
||||
arg.data.Remote,
|
||||
arg.data.Location
|
||||
);
|
||||
this.displayRetryMount(arg.data.Provider, arg.data.Remote, arg.data.Location);
|
||||
} else {
|
||||
this.detectMount(arg.data.Provider);
|
||||
}
|
||||
@@ -374,9 +347,7 @@ class MountItems extends IPCContainer {
|
||||
if (idx > -1) {
|
||||
this.activeDetections.splice(idx, 1);
|
||||
}
|
||||
this.props.setMountsBusy(
|
||||
this.activeDetections.length > 0 || this.hasActiveMount()
|
||||
);
|
||||
this.props.setMountsBusy(this.activeDetections.length > 0 || this.hasActiveMount());
|
||||
};
|
||||
|
||||
updateMountLocation = (provider, location, mounted, driveLetters) => {
|
||||
@@ -384,8 +355,7 @@ class MountItems extends IPCContainer {
|
||||
if (location.length === 0) {
|
||||
location =
|
||||
this.props.Platform === 'win32'
|
||||
? !providerState.MountLocation ||
|
||||
providerState.MountLocation.trim().length === 0
|
||||
? !providerState.MountLocation || providerState.MountLocation.trim().length === 0
|
||||
? driveLetters[0]
|
||||
: providerState.MountLocation
|
||||
: providerState.MountLocation;
|
||||
@@ -420,19 +390,14 @@ class MountItems extends IPCContainer {
|
||||
if (this.state.RetryItems.hasOwnProperty(provider)) {
|
||||
if (this.state.RetryItems[provider].RetryMessage) {
|
||||
retryList.push(
|
||||
<p key={'rl_' + retryList.length}>
|
||||
{this.state.RetryItems[provider].RetryMessage}
|
||||
</p>
|
||||
<p key={'rl_' + retryList.length}>{this.state.RetryItems[provider].RetryMessage}</p>
|
||||
);
|
||||
}
|
||||
retryList.push(
|
||||
<Button
|
||||
clicked={() =>
|
||||
this.cancelRetryMount(provider, () => this.detectMounts())
|
||||
}
|
||||
clicked={() => this.cancelRetryMount(provider, () => this.detectMounts())}
|
||||
key={'rl_' + retryList.length}>
|
||||
Cancel {provider} Remount (
|
||||
{this.state.RetryItems[provider].RetrySeconds}s)
|
||||
Cancel {provider} Remount ({this.state.RetryItems[provider].RetrySeconds}s)
|
||||
</Button>
|
||||
);
|
||||
if (++retryCount < Object.keys(this.state.RetryItems).length) {
|
||||
@@ -448,9 +413,7 @@ class MountItems extends IPCContainer {
|
||||
|
||||
retryDisplay = (
|
||||
<Modal>
|
||||
<Box
|
||||
dxDark
|
||||
dxStyle={{ padding: 'var(--default_spacing)', minWidth: '70vw' }}>
|
||||
<Box dxDark dxStyle={{ padding: 'var(--default_spacing)', minWidth: '70vw' }}>
|
||||
<h1
|
||||
style={{
|
||||
textAlign: 'center',
|
||||
@@ -475,9 +438,7 @@ class MountItems extends IPCContainer {
|
||||
/>
|
||||
);
|
||||
} else {
|
||||
footerItems.push(
|
||||
<div key={'hi_' + footerItems.length} style={{ height: '27px' }} />
|
||||
);
|
||||
footerItems.push(<div key={'hi_' + footerItems.length} style={{ height: '27px' }} />);
|
||||
}
|
||||
|
||||
let mountItems = [];
|
||||
@@ -495,9 +456,7 @@ class MountItems extends IPCContainer {
|
||||
<MountItem
|
||||
allowRemove={remote || s3}
|
||||
browseClicked={this.handleBrowseLocation}
|
||||
changed={(e) =>
|
||||
this.handleMountLocationChanged(provider, e.target.value)
|
||||
}
|
||||
changed={(e) => this.handleMountLocationChanged(provider, e.target.value)}
|
||||
clicked={this.handleMountUnMount}
|
||||
key={'it_' + mountItems.length}
|
||||
provider={provider}
|
||||
@@ -528,9 +487,7 @@ class MountItems extends IPCContainer {
|
||||
{retryDisplay}
|
||||
<div
|
||||
className={
|
||||
this.props.remoteSupported || this.props.s3Supported
|
||||
? 'MountItemsRemote'
|
||||
: 'MountItems'
|
||||
this.props.remoteSupported || this.props.s3Supported ? 'MountItemsRemote' : 'MountItems'
|
||||
}>
|
||||
{mountItems}
|
||||
</div>
|
||||
@@ -556,19 +513,15 @@ const mapStateToProps = (state) => {
|
||||
|
||||
const mapDispatchToProps = (dispatch) => {
|
||||
return {
|
||||
notifyError: (msg, critical, callback) =>
|
||||
dispatch(notifyError(msg, critical, callback)),
|
||||
notifyError: (msg, critical, callback) => dispatch(notifyError(msg, critical, callback)),
|
||||
resetMountsState: () => dispatch(resetMountsState()),
|
||||
setAllowMount: (provider, allow) =>
|
||||
dispatch(setAllowMount(provider, allow)),
|
||||
setAllowMount: (provider, allow) => dispatch(setAllowMount(provider, allow)),
|
||||
setAutoMountProcessed: (provider, processed) =>
|
||||
dispatch(setAutoMountProcessed(provider, processed)),
|
||||
setMounted: (provider, mounted) => dispatch(setMounted(provider, mounted)),
|
||||
setMountsBusy: (busy) => dispatch(setBusy(busy)),
|
||||
setMountState: (provider, state) =>
|
||||
dispatch(setMountState(provider, state)),
|
||||
setProviderState: (provider, state) =>
|
||||
dispatch(setProviderState(provider, state)),
|
||||
setMountState: (provider, state) => dispatch(setMountState(provider, state)),
|
||||
setProviderState: (provider, state) => dispatch(setProviderState(provider, state)),
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user