Update prettier/eslint
This commit is contained in:
@@ -21,8 +21,7 @@ const mapStateToProps = (state) => {
|
||||
const mapDispatchToProps = (dispatch) => {
|
||||
return {
|
||||
displaySkynetImport: (display) => dispatch(displaySkynetImport(display)),
|
||||
notifyApplicationBusy: (busy) =>
|
||||
dispatch(notifyApplicationBusy(busy, true)),
|
||||
notifyApplicationBusy: (busy) => dispatch(notifyApplicationBusy(busy, true)),
|
||||
notifyError: (msg) => dispatch(notifyError(msg)),
|
||||
notifyInfo: (title, msg) => dispatch(notifyInfo(title, msg)),
|
||||
};
|
||||
@@ -40,10 +39,7 @@ export default connect(
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
this.setRequestHandler(
|
||||
Constants.IPC_Import_Skylinks_Reply,
|
||||
this.onImportSkylinksReply
|
||||
);
|
||||
this.setRequestHandler(Constants.IPC_Import_Skylinks_Reply, this.onImportSkylinksReply);
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
@@ -119,9 +115,7 @@ export default connect(
|
||||
part = part.trim();
|
||||
const pair = part.split('=');
|
||||
if (pair.length !== 2) {
|
||||
throw new Error(
|
||||
'Invalid syntax for import: directory="",skylink="",token=""'
|
||||
);
|
||||
throw new Error('Invalid syntax for import: directory="",skylink="",token=""');
|
||||
}
|
||||
importItem = {
|
||||
...importItem,
|
||||
@@ -129,9 +123,7 @@ export default connect(
|
||||
};
|
||||
}
|
||||
if (!importItem.skylink) {
|
||||
throw new Error(
|
||||
'Invalid syntax for import: directory="",skylink="",token=""'
|
||||
);
|
||||
throw new Error('Invalid syntax for import: directory="",skylink="",token=""');
|
||||
}
|
||||
importsArray.push(importItem);
|
||||
} else if (item.length > 0) {
|
||||
@@ -165,22 +157,15 @@ export default connect(
|
||||
this.setState(
|
||||
{
|
||||
import_text:
|
||||
failedImportsArray.length > 0
|
||||
? JSON.stringify(failedImportsArray, null, 2)
|
||||
: '',
|
||||
failedImportsArray.length > 0 ? JSON.stringify(failedImportsArray, null, 2) : '',
|
||||
imports_array: [],
|
||||
second_stage: false,
|
||||
},
|
||||
() => {
|
||||
if (failedImportsArray.length > 0) {
|
||||
this.props.notifyError(
|
||||
`Failed to import ${failedImportsArray.length} item(s)`
|
||||
);
|
||||
this.props.notifyError(`Failed to import ${failedImportsArray.length} item(s)`);
|
||||
} else {
|
||||
this.props.notifyInfo(
|
||||
'Import Result',
|
||||
`Successfully imported ${count} item(s)`
|
||||
);
|
||||
this.props.notifyInfo('Import Result', `Successfully imported ${count} item(s)`);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user