From de1c89af21dff08cf75135228e745bd2e4b1df6d Mon Sep 17 00:00:00 2001
From: TrainDoctor <traindoctor@protonmail.com>
Date: Tue, 23 Aug 2022 15:23:23 -0700
Subject: Fix updater being corrupted by multiple attempts to download

---
 frontend/src/components/DeckyState.tsx | 8 ++++++++
 1 file changed, 8 insertions(+)

(limited to 'frontend/src/components/DeckyState.tsx')

diff --git a/frontend/src/components/DeckyState.tsx b/frontend/src/components/DeckyState.tsx
index 6f13a007..739da0e1 100644
--- a/frontend/src/components/DeckyState.tsx
+++ b/frontend/src/components/DeckyState.tsx
@@ -8,6 +8,7 @@ interface PublicDeckyState {
   activePlugin: Plugin | null;
   updates: PluginUpdateMapping | null;
   hasLoaderUpdate?: boolean;
+  isLoaderUpdating: boolean;
 }
 
 export class DeckyState {
@@ -15,6 +16,7 @@ export class DeckyState {
   private _activePlugin: Plugin | null = null;
   private _updates: PluginUpdateMapping | null = null;
   private _hasLoaderUpdate: boolean = false;
+  private _isLoaderUpdating: boolean = false;
 
   public eventBus = new EventTarget();
 
@@ -24,6 +26,7 @@ export class DeckyState {
       activePlugin: this._activePlugin,
       updates: this._updates,
       hasLoaderUpdate: this._hasLoaderUpdate,
+      isLoaderUpdating: this._isLoaderUpdating,
     };
   }
 
@@ -52,6 +55,11 @@ export class DeckyState {
     this.notifyUpdate();
   }
 
+  setIsLoaderUpdating(isUpdating: boolean) {
+    this._isLoaderUpdating = isUpdating;
+    this.notifyUpdate();
+  }
+
   private notifyUpdate() {
     this.eventBus.dispatchEvent(new Event('update'));
   }
-- 
cgit v1.2.3

