This commit is contained in:
Junhui Chen 2025-08-09 13:13:18 +08:00
parent 76f2e6ed48
commit 4c4360cefc

View File

@ -1,6 +1,6 @@
import { ThemedText } from "@/components/ThemedText"; import { ThemedText } from "@/components/ThemedText";
import { Message } from "@/types/ask"; import { Message } from "@/types/ask";
import { Dispatch, SetStateAction, useRef } from "react"; import { Dispatch, SetStateAction, useCallback, useRef } from "react";
import { useTranslation } from "react-i18next"; import { useTranslation } from "react-i18next";
import { View } from 'react-native'; import { View } from 'react-native';
@ -16,7 +16,7 @@ export default function AskHello({ setUserMessages, setConversationId, setIsHell
// //
const inFlightRef = useRef(false); const inFlightRef = useRef(false);
// const handleCase = useCallback(async (text: string) => { const handleCase = useCallback(async (text: string) => {
// if (inFlightRef.current) return; // if (inFlightRef.current) return;
// inFlightRef.current = true; // inFlightRef.current = true;
// try { // try {
@ -68,7 +68,7 @@ export default function AskHello({ setUserMessages, setConversationId, setIsHell
// } finally { // } finally {
// inFlightRef.current = false; // inFlightRef.current = false;
// } // }
// }, [setConversationId, setIsHello, setUserMessages]); }, [setConversationId, setIsHello, setUserMessages]);
return ( return (
<View className="flex-1 bg-white w-full"> <View className="flex-1 bg-white w-full">