diff --git a/app/backend/InputOutputHandler.tsx b/app/backend/InputOutputHandler.tsx index 1316901..381ef88 100644 --- a/app/backend/InputOutputHandler.tsx +++ b/app/backend/InputOutputHandler.tsx @@ -5,7 +5,6 @@ import InputFrontend from "../components/InputFrontend"; import VoiceSend from "./voice_backend" import { AudioRecorder } from "./AudioRecorder"; import axios from "axios"; -import { resolve } from "path"; const InputOutputBackend: React.FC = () => { @@ -14,7 +13,6 @@ const InputOutputBackend: React.FC = () => { content: string } - const [copyClicked, setCopyClicked] = useState(false) const [accessToken, setAccessToken] = useState("") const postWorkerRef = useRef(null) const getWorkerRef = useRef(null) @@ -201,26 +199,13 @@ const InputOutputBackend: React.FC = () => { } const handleCopyClick = async () => { - setCopyClicked(false) try { await navigator.clipboard.writeText(messages[messages.length - 1]['content']); - fadeCopyText() } catch (err) { console.error('Failed to copy: ', err); } } - const wait = (time: number) => { - return new Promise(resolve => setTimeout(resolve, time)); - } - - const fadeCopyText = async () => { - setCopyClicked(true) - await wait(1000) - setCopyClicked(false) - } - - return (
{ onResendClick={handleResendClick} onEditClick={handleEditClick} onCopyClick={handleCopyClick} - isClicked={copyClicked} /> void; onEditClick: () => void; onCopyClick: () => void; - isClicked:boolean } const ConversationFrontend = React.forwardRef( - ({ messages, onResendClick, onEditClick, onCopyClick, isClicked}, ref: ForwardedRef) => { + ({ messages, onResendClick, onEditClick, onCopyClick }, ref: ForwardedRef) => { const endOfMessagesRef = useRef(null); // Auto-scroll to the bottom of the conversation whenever a new message is added @@ -24,11 +23,6 @@ const ConversationFrontend = React.forwardRef } }, [messages]); // Triggers the effect whenever the 'messages' array changes - useEffect(() => { - console.log(isClicked); - - },[isClicked]) - return (
@@ -39,8 +33,8 @@ const ConversationFrontend = React.forwardRef } return (

{message.content}

@@ -58,7 +52,6 @@ const ConversationFrontend = React.forwardRef -

Copied!