From 3cb9228defb29bc3517a5c0524f959f01ad85a2b Mon Sep 17 00:00:00 2001 From: Colby Sieber Date: Thu, 6 Aug 2020 00:03:23 -0700 Subject: [PATCH] Add missing "await" on minify call. Fixes #9. --- src/Repl.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Repl.js b/src/Repl.js index eb20ed9..b24f33a 100644 --- a/src/Repl.js +++ b/src/Repl.js @@ -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 });