Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing "await" on minify call. Fixes #9. #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Repl.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,13 @@ class Repl extends Component {
DEBOUNCE_DELAY
);

_minify = (code, setStateCallback) => {
_minify = async (code, setStateCallback) => {
// we need to clone this because terser mutates the options object :(
const terserOpts = cloneDeep(this.state.terserOptions);

// TODO: put this in a worker to avoid blocking the UI on heavy content
try {
const result = this.props.terser.minify(code, terserOpts);
const result = await this.props.terser.minify(code, terserOpts);

if (result.error) {
this.setState({ errorMessage: result.error.message });
Expand Down