Skip to content

Commit

Permalink
Drop delay@2.0 because UglifyJS doesn't support ES2015 syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
cheton committed Mar 27, 2017
1 parent c21f171 commit f2c118e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@
"cookie-parser": "~1.4.3",
"debug": "~2.6.3",
"del": "~2.2.2",
"delay": "~2.0.0",
"errorhandler": "~1.5.0",
"es5-shim": "~4.5.9",
"expr-eval": "~1.0.0",
Expand Down
9 changes: 4 additions & 5 deletions src/web/widgets/Visualizer/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import classNames from 'classnames';
import includes from 'lodash/includes';
import get from 'lodash/get';
import mapValues from 'lodash/mapValues';
import delay from 'delay';
import pubsub from 'pubsub-js';
import React, { Component } from 'react';
import shallowCompare from 'react-addons-shallow-compare';
Expand Down Expand Up @@ -210,7 +209,7 @@ class VisualizerWidget extends Component {
return;
}

delay(0).then(() => {
setTimeout(() => {
this.visualizer.load(name, gcode, ({ bbox }) => {
// Set gcode bounding box
controller.context = {
Expand All @@ -235,7 +234,7 @@ class VisualizerWidget extends Component {
}
});
});
});
}, 0);
});
},
unloadGCode: () => {
Expand Down Expand Up @@ -572,9 +571,9 @@ class VisualizerWidget extends Component {
if (!Detector.webgl && !this.state.disabled) {
displayWebGLErrorMessage();

delay(0).then(() => {
setTimeout(() => {
this.setState({ disabled: true });
});
}, 0);
}
}
componentWillUnmount() {
Expand Down
8 changes: 3 additions & 5 deletions src/web/widgets/Webcam/Webcam.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import classNames from 'classnames';
import delay from 'delay';
import Slider from 'rc-slider';
import React, { Component, PropTypes } from 'react';
import ReactDOM from 'react-dom';
Expand Down Expand Up @@ -36,10 +35,9 @@ class Webcam extends Component {
const el = ReactDOM.findDOMNode(this.mediaSource);
el.src = '';

delay(10) // delay 10ms
.then(() => {
el.src = state.url;
});
setTimeout(() => {
el.src = state.url;
}, 10); // delay 10ms
}
}
render() {
Expand Down

0 comments on commit f2c118e

Please sign in to comment.