From 5b63917db308ab75dc765de543e97819f16924b7 Mon Sep 17 00:00:00 2001
From: Nate Sesti <sestinj@gmail.com>
Date: Thu, 6 Jul 2023 20:07:45 -0700
Subject: details

---
 extension/react-app/src/tabs/gui.tsx | 26 ++------------------------
 1 file changed, 2 insertions(+), 24 deletions(-)

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

diff --git a/extension/react-app/src/tabs/gui.tsx b/extension/react-app/src/tabs/gui.tsx
index c8a42d9a..1ea70dd2 100644
--- a/extension/react-app/src/tabs/gui.tsx
+++ b/extension/react-app/src/tabs/gui.tsx
@@ -217,25 +217,10 @@ function GUI(props: GUIProps) {
     [client]
   );
 
-  useEffect(() => {
-    if (mainTextInputRef.current) {
-      mainTextInputRef.current.focus();
-      let handler = (event: any) => {
-        if (event.data.type === "focusContinueInput") {
-          mainTextInputRef.current?.focus();
-        }
-      };
-      window.addEventListener("message", handler);
-      return () => {
-        window.removeEventListener("message", handler);
-      };
-    }
-  }, [mainTextInputRef]);
-
   const onMainTextInput = () => {
     if (mainTextInputRef.current) {
-      let input = mainTextInputRef.current.value;
-      mainTextInputRef.current.value = "";
+      const input = (mainTextInputRef.current as any).inputValue;
+      (mainTextInputRef.current as any).setInputValue("");
       if (!client) return;
 
       setWaitingForSteps(true);
@@ -266,13 +251,6 @@ function GUI(props: GUIProps) {
       setUserInputQueue((queue) => {
         return [...queue, input];
       });
-
-      // Delete all context items unless locked
-      if (!pinned) {
-        client?.deleteContextAtIndices(
-          highlightedRanges.map((_, index) => index)
-        );
-      }
     }
   };
 
-- 
cgit v1.2.3-70-g09d2

