mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-11 16:26:20 +00:00
Unset loading on error. Fixes #855
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user