mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-12 08:47:31 +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) {
|
} catch (err) {
|
||||||
if (err.name === 'AbortError') return;
|
if (err.name === 'AbortError') return;
|
||||||
|
this.setState({ loading: false });
|
||||||
this.props.showSnack(`Preprocessing error: ${err}`);
|
this.props.showSnack(`Preprocessing error: ${err}`);
|
||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
@@ -772,6 +773,12 @@ export default class Compress extends Component<Props, State> {
|
|||||||
this.activeSideJobs[sideIndex] = undefined;
|
this.activeSideJobs[sideIndex] = undefined;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (err.name === 'AbortError') return;
|
if (err.name === 'AbortError') return;
|
||||||
|
this.setState((currentState) => {
|
||||||
|
const sides = cleanMerge(currentState.sides, sideIndex, {
|
||||||
|
loading: false,
|
||||||
|
});
|
||||||
|
return { sides };
|
||||||
|
});
|
||||||
this.props.showSnack(`Processing error: ${err}`);
|
this.props.showSnack(`Processing error: ${err}`);
|
||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user