From d18520b1f6204cc024e8b3745df03cba783975e3 Mon Sep 17 00:00:00 2001
From: ali asaria <aliasaria@users.noreply.github.com>
Date: Mon, 20 Jan 2025 11:28:22 -0500
Subject: [PATCH] fix for ubuntu installer never completes on first run

---
 .../components/Connect/LocalConnection.tsx      | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/src/renderer/components/Connect/LocalConnection.tsx b/src/renderer/components/Connect/LocalConnection.tsx
index dc7abdc1..98231325 100644
--- a/src/renderer/components/Connect/LocalConnection.tsx
+++ b/src/renderer/components/Connect/LocalConnection.tsx
@@ -325,6 +325,7 @@ function InstallStepper({ setServer }) {
       } else {
         if (userRequestedInstall) {
           stepsFunctions[Steps.indexOf('CHECK_FOR_IMPORTANT_PLUGINS')]();
+          stepsFunctions[Steps.indexOf('CHECK_FOR_IMPORTANT_PLUGINS') + 1](); // This connects and closes the window
         }
       }
     })();
@@ -533,12 +534,17 @@ function InstallStepper({ setServer }) {
 
   async function checkForPlugins() {
     setInstallingPlugins(true);
+    console.log('Startign to check for plugins');
     await fetch(
       'http://localhost:8338/plugins/install_missing_plugins_for_current_platform'
     );
+    console.log('call to check for plugins has returned');
     setInstallingPlugins(false);
     setMissingPlugins([]);
+    const nextStep = Steps.indexOf('CHECK_FOR_IMPORTANT_PLUGINS') + 1;
+    console.log(nextStep);
     setActiveStep(Steps.indexOf('CHECK_FOR_IMPORTANT_PLUGINS') + 1);
+    console.log('setting active step to: ' + Steps.indexOf('CHECK_FOR_IMPORTANT_PLUGINS') + 1)
   }
 
   var stepsFunctions: (() => Promise<void>)[] = [];
@@ -571,11 +577,13 @@ function InstallStepper({ setServer }) {
       // don't run set thinking -- server needs to be polled
     };
   stepsFunctions[Steps.indexOf('CHECK_FOR_IMPORTANT_PLUGINS')] = async () => {
+    console.log(Steps.indexOf('CHECK_FOR_IMPORTANT_PLUGINS'));
     await checkForPlugins();
     setThinking(false);
   };
   // The following is the a fake step: we are done so we just connect
   stepsFunctions[7] = async () => {
+    console.log('entering step 7')
     tryToConnect();
   };
 
@@ -645,7 +653,13 @@ function InstallStepper({ setServer }) {
                 If it appears like nothing is happening for a while, check the
                 terminal for any potential errors. You can safely close the the
                 application and start it again if things appear stuck for more
-                than a minute.
+                than a couple minutes.
+                <br />
+                <br />
+                One place where the Python conda installer pauses is when you see "more hidden" on the bottom of the screen. This can take a few minutes.
+                <br />
+                <br />
+                The other part takes takes a while is when you see "Installing collected packages"
               </>
             )}
           </Typography>
@@ -670,6 +684,7 @@ function InstallStepper({ setServer }) {
             This panel starts up and connects to the Transformer Lab Engine on
             your local machine. If you have access to a separate computer with a
             powerful GPU, use "Connect to Remote Engine" instead.
+            Active step: {activeStep}
           </Typography>
         </Alert>
         {installStatus === 'error' && (
-- 
GitLab