From 6d0d9dc0223548950f77ec35d61f2f48916f2315 Mon Sep 17 00:00:00 2001 From: Jake Archibald Date: Tue, 10 Nov 2020 11:57:28 +0000 Subject: [PATCH] Clear loading states --- src/client/lazy-app/Compress/index.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/client/lazy-app/Compress/index.tsx b/src/client/lazy-app/Compress/index.tsx index c133b32c..48446fc9 100644 --- a/src/client/lazy-app/Compress/index.tsx +++ b/src/client/lazy-app/Compress/index.tsx @@ -497,7 +497,17 @@ export default class Compress extends Component { } } - if (!jobNeeded) return; + if (!jobNeeded) { + // Clear any loading that may be happening + this.setState((state) => ({ + loading: false, + sides: state.sides.map((side) => ({ ...side, loading: false })) as [ + Side, + Side, + ], + })); + return; + } const mainSignal = this.mainAbortController.signal; const sideSignals = this.sideAbortControllers.map((ac) => ac.signal);