From 98e9ce881f8df4647be2181f4af379a86bfb090e Mon Sep 17 00:00:00 2001
From: AAGaming <aa@mail.catvibers.me>
Date: Wed, 24 Aug 2022 20:03:29 -0400
Subject: move DeckyUpdater to effect

---
 .../components/settings/pages/general/Updater.tsx  | 25 ++++++++++++----------
 1 file changed, 14 insertions(+), 11 deletions(-)

(limited to 'frontend/src/components/settings/pages/general/Updater.tsx')

diff --git a/frontend/src/components/settings/pages/general/Updater.tsx b/frontend/src/components/settings/pages/general/Updater.tsx
index edfcf724..e0abe0a0 100644
--- a/frontend/src/components/settings/pages/general/Updater.tsx
+++ b/frontend/src/components/settings/pages/general/Updater.tsx
@@ -19,6 +19,20 @@ export default function UpdaterSettings() {
     })();
   }, []);
 
+  useEffect(() => {
+    window.DeckyUpdater = {
+      updateProgress: (i) => {
+        setUpdateProgress(i);
+        setIsLoaderUpdating(true);
+      },
+      finish: async () => {
+        setUpdateProgress(0);
+        setReloading(true);
+        await finishUpdate();
+      },
+    };
+  }, []);
+
   return (
     <Field
       label="Updates"
@@ -49,17 +63,6 @@ export default function UpdaterSettings() {
                   setCheckingForUpdates(false);
                 }
               : async () => {
-                  window.DeckyUpdater = {
-                    updateProgress: (i) => {
-                      setUpdateProgress(i);
-                      setIsLoaderUpdating(true);
-                    },
-                    finish: async () => {
-                      setUpdateProgress(0);
-                      setReloading(true);
-                      await finishUpdate();
-                    },
-                  };
                   setUpdateProgress(0);
                   callUpdaterMethod('do_update');
                 }
-- 
cgit v1.2.3

