From f11e692d585ffa45f34c206c5a93e734deb7ad75 Mon Sep 17 00:00:00 2001 From: Jake Archibald Date: Fri, 20 Nov 2020 16:11:57 +0000 Subject: [PATCH] Unset loading on error. Fixes #855 --- src/client/lazy-app/Compress/index.tsx | 7 +++++++ 1 file changed, 7 insertions(+) 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 { }); } 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 { 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; }