From e19c918bb1c517a6a119ae8437c46e0724d2be9d Mon Sep 17 00:00:00 2001
From: Nate Sesti <sestinj@gmail.com>
Date: Wed, 4 Oct 2023 01:36:33 -0700
Subject: feat: :lipstick: better loading experience

---
 extension/react-app/src/pages/gui.tsx | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

(limited to 'extension/react-app/src/pages/gui.tsx')

diff --git a/extension/react-app/src/pages/gui.tsx b/extension/react-app/src/pages/gui.tsx
index 12835121..b8199c19 100644
--- a/extension/react-app/src/pages/gui.tsx
+++ b/extension/react-app/src/pages/gui.tsx
@@ -45,6 +45,7 @@ import FTCDialog from "../components/dialogs/FTCDialog";
 import HeaderButtonWithText from "../components/HeaderButtonWithText";
 import { useNavigate } from "react-router-dom";
 import SuggestionsArea from "../components/Suggestions";
+import { setTakenActionTrue } from "../redux/slices/miscSlice";
 
 const TopGuiDiv = styled.div`
   overflow-y: scroll;
@@ -158,6 +159,7 @@ function GUI(props: GUIProps) {
   const bottomMessage = useSelector(
     (state: RootStore) => state.uiState.bottomMessage
   );
+  const takenAction = useSelector((state: RootStore) => state.misc.takenAction);
   useEffect(() => {
     if (!aboveComboBoxDivRef.current) return;
     dispatch(
@@ -263,6 +265,7 @@ function GUI(props: GUIProps) {
   }, [client, user_input_queue, waitingForClient]);
 
   const onMainTextInput = (event?: any) => {
+    dispatch(setTakenActionTrue(null));
     if (mainTextInputRef.current) {
       let input = (mainTextInputRef.current as any).inputValue;
 
@@ -477,7 +480,7 @@ function GUI(props: GUIProps) {
   useEffect(() => {
     const timeout = setTimeout(() => {
       setShowLoading(true);
-    }, 3000);
+    }, 10000);
 
     return () => {
       clearTimeout(timeout);
@@ -558,7 +561,7 @@ function GUI(props: GUIProps) {
           </HeaderButtonWithText>
         </div>
       </GUIHeaderDiv>
-      {showLoading && typeof client === "undefined" && (
+      {(takenAction || showLoading) && typeof client === "undefined" && (
         <>
           <RingLoader />
           <p
-- 
cgit v1.2.3-70-g09d2

