Skip to content

Make images smaller using best-in-class codecs, right in the browser.

JavaScript

Unset loading on error. Fixes #855

Jake Archibaldf11e692d585f
diff --git a/src/client/lazy-app/Compress/index.tsx b/src/client/lazy-app/Compress/index.tsx
index 63af05ee..bcd84242 100644
--- a/src/client/lazy-app/Compress/index.tsx
+++ b/src/client/lazy-app/Compress/index.tsx
@@ -649,6 +649,7 @@ export default class Compress extends Component<Props, State> {
});
} catch (err) {
if (err.name === 'AbortError') return;
+ this.setState({ loading: false });
this.props.showSnack(`Preprocessing error: ${err}`);
throw err;
}
@@ -772,6 +773,12 @@ export default class Compress extends Component<Props, State> {
this.activeSideJobs[sideIndex] = undefined;
} catch (err) {
if (err.name === 'AbortError') return;
+ this.setState((currentState) => {
+ const sides = cleanMerge(currentState.sides, sideIndex, {
+ loading: false,
+ });
+ return { sides };
+ });
this.props.showSnack(`Processing error: ${err}`);
throw err;
}