mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-30 18:48:55 +00:00
perf: variable label picker scroll & focus disappear (#2135)
* fix: variable label picker scroll & focus disappear * fix * fix filter * revert
This commit is contained in:
@@ -35,6 +35,7 @@ type useChatStoreType = OutLinkChatAuthProps &
|
||||
ChatProviderProps & {
|
||||
welcomeText: string;
|
||||
variableList: VariableItemType[];
|
||||
allVariableList: VariableItemType[];
|
||||
questionGuide: boolean;
|
||||
ttsConfig: AppTTSConfigType;
|
||||
whisperConfig: AppWhisperConfigType;
|
||||
@@ -189,6 +190,7 @@ const Provider = ({
|
||||
teamToken,
|
||||
welcomeText,
|
||||
variableList: variables.filter((item) => item.type !== VariableInputEnum.custom),
|
||||
allVariableList: variables,
|
||||
questionGuide,
|
||||
ttsConfig,
|
||||
whisperConfig,
|
||||
|
@@ -21,7 +21,7 @@ const VariableInput = ({
|
||||
const { t } = useTranslation();
|
||||
|
||||
const { appAvatar, variableList, variablesForm } = useContextSelector(ChatBoxContext, (v) => v);
|
||||
const { register, getValues, setValue, handleSubmit: handleSubmitChat, control } = variablesForm;
|
||||
const { register, setValue, handleSubmit: handleSubmitChat, control } = variablesForm;
|
||||
|
||||
return (
|
||||
<Box py={3}>
|
||||
|
@@ -140,6 +140,7 @@ const ChatBox = (
|
||||
const {
|
||||
welcomeText,
|
||||
variableList,
|
||||
allVariableList,
|
||||
questionGuide,
|
||||
startSegmentedAudio,
|
||||
finishSegmentedAudio,
|
||||
@@ -390,7 +391,7 @@ const ChatBox = (
|
||||
|
||||
// delete invalid variables, 只保留在 variableList 中的变量
|
||||
const requestVariables: Record<string, any> = {};
|
||||
variableList?.forEach((item) => {
|
||||
allVariableList?.forEach((item) => {
|
||||
requestVariables[item.key] = variables[item.key] || '';
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user