mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-09-22 06:00:56 +02:00
bug: updating so text doesn't delete
This commit is contained in:
parent
99135a3dc1
commit
1341faec85
1 changed files with 11 additions and 0 deletions
|
@ -81,6 +81,7 @@ const ChatForm = memo(({ index = 0 }: { index?: number }) => {
|
|||
} = useAddedChatContext();
|
||||
const assistantMap = useAssistantsMapContext();
|
||||
const showStopAdded = useRecoilValue(store.showStopButtonByIndex(addedIndex));
|
||||
const hasHandledSubmit = useRef(false);
|
||||
|
||||
const endpoint = useMemo(
|
||||
() => conversation?.endpointType ?? conversation?.endpoint,
|
||||
|
@ -177,6 +178,16 @@ const ChatForm = memo(({ index = 0 }: { index?: number }) => {
|
|||
}
|
||||
}, [isEditingBadges, badges, backupBadges.length]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!isSubmitting && !isSubmittingAdded && !hasHandledSubmit.current) {
|
||||
hasHandledSubmit.current = true;
|
||||
methods.setValue('text', textValue, { shouldValidate: true });
|
||||
}
|
||||
if (isSubmitting || isSubmittingAdded) {
|
||||
hasHandledSubmit.current = false;
|
||||
}
|
||||
}, [isSubmitting, isSubmittingAdded, methods, textValue]);
|
||||
|
||||
const handleSaveBadges = useCallback(() => {
|
||||
setIsEditingBadges(false);
|
||||
setBackupBadges([]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue