mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-22 12:20:34 +00:00
fix: ts (#3296)
This commit is contained in:
@@ -83,6 +83,7 @@ enum FeedbackTypeEnum {
|
||||
|
||||
type Props = OutLinkChatAuthProps &
|
||||
ChatProviderProps & {
|
||||
isReady: boolean;
|
||||
feedbackType?: `${FeedbackTypeEnum}`;
|
||||
showMarkIcon?: boolean; // admin mark dataset
|
||||
showVoiceIcon?: boolean;
|
||||
@@ -97,6 +98,7 @@ type Props = OutLinkChatAuthProps &
|
||||
};
|
||||
|
||||
const ChatBox = ({
|
||||
isReady = true,
|
||||
feedbackType = FeedbackTypeEnum.hidden,
|
||||
showMarkIcon = false,
|
||||
showVoiceIcon = true,
|
||||
@@ -829,11 +831,12 @@ const ChatBox = ({
|
||||
eventBus.off(EventNameEnum.sendQuestion);
|
||||
eventBus.off(EventNameEnum.editQuestion);
|
||||
};
|
||||
}, [chatBoxData, resetInputVal, sendPrompt]);
|
||||
}, [isReady, resetInputVal, sendPrompt]);
|
||||
|
||||
// Auto send prompt
|
||||
useEffect(() => {
|
||||
if (
|
||||
isReady &&
|
||||
chatBoxData?.app?.chatConfig?.autoExecute?.open &&
|
||||
chatStarted &&
|
||||
chatRecords.length === 0 &&
|
||||
@@ -845,6 +848,7 @@ const ChatBox = ({
|
||||
});
|
||||
}
|
||||
}, [
|
||||
isReady,
|
||||
chatStarted,
|
||||
chatRecords.length,
|
||||
isChatRecordsLoaded,
|
||||
|
@@ -154,6 +154,7 @@ const DetailLogsModal = ({ appId, chatId, onClose }: Props) => {
|
||||
</Box>
|
||||
) : (
|
||||
<ChatBox
|
||||
isReady
|
||||
appId={appId}
|
||||
chatId={chatId}
|
||||
feedbackType={'admin'}
|
||||
|
@@ -82,6 +82,7 @@ export const useChatTest = ({
|
||||
useEffect(() => {
|
||||
setChatBoxData({
|
||||
userAvatar: userInfo?.avatar,
|
||||
appId: appId,
|
||||
app: {
|
||||
chatConfig,
|
||||
name: appDetail.name,
|
||||
@@ -94,6 +95,7 @@ export const useChatTest = ({
|
||||
appDetail.avatar,
|
||||
appDetail.name,
|
||||
appDetail.type,
|
||||
appId,
|
||||
chatConfig,
|
||||
pluginInputs,
|
||||
setChatBoxData,
|
||||
|
@@ -209,6 +209,7 @@ const Chat = ({ myApps }: { myApps: AppListItemType[] }) => {
|
||||
chatType={'chat'}
|
||||
showRawSource
|
||||
showNodeStatus
|
||||
isReady={!loading}
|
||||
/>
|
||||
)}
|
||||
</Box>
|
||||
|
@@ -278,6 +278,7 @@ const OutLink = (props: Props) => {
|
||||
/>
|
||||
) : (
|
||||
<ChatBox
|
||||
isReady={!loading}
|
||||
appId={appId}
|
||||
chatId={chatId}
|
||||
outLinkAuthData={outLinkAuthData}
|
||||
|
@@ -218,6 +218,7 @@ const Chat = ({ myApps }: { myApps: AppListItemType[] }) => {
|
||||
/>
|
||||
) : (
|
||||
<ChatBox
|
||||
isReady={!loading}
|
||||
appId={appId}
|
||||
chatId={chatId}
|
||||
outLinkAuthData={outLinkAuthData}
|
||||
|
Reference in New Issue
Block a user