Skip to content

Commit 643a482

Browse files
committed
#417 cleanup
1 parent c3938bb commit 643a482

File tree

2 files changed

+21
-18
lines changed

2 files changed

+21
-18
lines changed

webapp/components/instantiation/NetPyNEInstantiated.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ import {
77
} from '../../theme';
88
import { THEMES } from '../../constants';
99

10-
require('source-map-support').install();
11-
1210
const CANVAS_LIGHT = 'canvas-toolbar-btns-light';
1311
const CANVAS_DARK = 'canvas-toolbar-btns-dark';
1412
const SELECTION_COLOR = {

webapp/redux/middleware/middleware.js

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable lines-between-class-members */
12
import {
23
CLONE_EXPERIMENT,
34
GET_EXPERIMENTS,
@@ -47,7 +48,7 @@ export const processError = (response) => {
4748
return {
4849
errorMessage: parsedResponse.message,
4950
errorDetails: parsedResponse.details,
50-
additionalInfo: parsedResponse.additionalInfo
51+
additionalInfo: parsedResponse.additionalInfo,
5152
};
5253
}
5354
return false;
@@ -117,18 +118,17 @@ const simulateNetwork = (payload) => createSimulateBackendCall(
117118

118119
class PythonMessageFilter {
119120
errorIds = new Set();
120-
shouldLaunch(e) {
121+
shouldLaunch (e) {
121122
const errorId = e.additionalInfo?.sim_id ;
122-
if (!errorId)
123-
return true ;
124-
if (errorId)
125-
{
126-
if(this.errorIds.has(errorId))
127-
return false ;
128-
else {
129-
this.errorIds.add(errorId);
130-
return true ;
123+
if (!errorId) {
124+
return true;
125+
}
126+
if (errorId) {
127+
if (this.errorIds.has(errorId)) {
128+
return false;
131129
}
130+
this.errorIds.add(errorId);
131+
return true;
132132
}
133133
}
134134
}
@@ -167,10 +167,10 @@ export default (store) => (next) => (action) => {
167167

168168
const pythonErrorCallback = (error) => {
169169
console.debug(Utils.getPlainStackTrace(error.errorDetails));
170-
if (errorMessageFilter.shouldLaunch(error))
170+
if (errorMessageFilter.shouldLaunch(error)) {
171171
return next(openBackendErrorDialog(error));
172-
else
173-
return next(action);
172+
}
173+
return next(action);
174174
};
175175

176176
switch (action.type) {
@@ -219,13 +219,18 @@ export default (store) => (next) => (action) => {
219219
break;
220220
}
221221
case CREATE_SIMULATE_NETWORK: {
222-
const payload = { allTrials: false, simId: new Date().getTime() }
222+
const payload = { allTrials: false, simId: new Date().getTime() };
223223
simulateNetwork(payload)
224224
.then(toNetworkCallback(false), pythonErrorCallback);
225225
break;
226226
}
227227
case SIMULATE_NETWORK:
228-
const payload = { allTrials: action.payload, simId: new Date().getTime(), usePrevInst: false }
228+
// eslint-disable-next-line no-case-declarations
229+
const payload = {
230+
allTrials: action.payload,
231+
simId: new Date().getTime(),
232+
usePrevInst: false,
233+
};
229234
simulateNetwork(payload)
230235
.then(toNetworkCallback(false), pythonErrorCallback);
231236
break;

0 commit comments

Comments
 (0)