🧹 chore: pre-release cleanup (#3595)

* fix: Update health endpoint URL

* refactor: use Constants for saved tag default value, do not place Saved as first always

* refactor: check trimmed currentText before appending parsedText in useSubmitMessage

* refactor: move `scrollToEnd()` to `createdHandler` and increase delay before execution slightly

* chore: Add back TypeScript linting rules for unnecessary conditions and strict boolean expressions

* chore: Update librechat-data-provider package.json version to 0.7.4.0
This commit is contained in:
Danny Avila 2024-08-09 02:11:56 -04:00 committed by GitHub
parent e05a6d306d
commit 473859b0e2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 16 additions and 25 deletions

View file

@ -11,7 +11,6 @@ import { Spinner } from '~/components';
import { cn } from '~/utils';
import store from '~/store';
const SAVED_TAG = 'Saved';
const BookmarkMenu: FC = () => {
const localize = useLocalize();
@ -47,7 +46,7 @@ const BookmarkMenu: FC = () => {
if (conversation && conversationId) {
await mutateAsync(
{
tags: [SAVED_TAG],
tags: [Constants.SAVED_TAG as 'Saved'],
},
{
onSuccess: (newTags: string[]) => {

View file

@ -1,4 +1,5 @@
import {
Constants,
EToolResources,
LocalStorageKeys,
InfiniteCollections,
@ -322,9 +323,9 @@ export const useConversationTagMutation = (
if (!data) {
return [
{
tag: 'Saved',
count: 1,
position: 0,
tag: Constants.SAVED_TAG,
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
},

View file

@ -18,8 +18,8 @@ import type {
import type { SetterOrUpdater } from 'recoil';
import type { TAskFunction, ExtendedFile } from '~/common';
import useSetFilesToDelete from '~/hooks/Files/useSetFilesToDelete';
import { getEndpointField, logger, scrollToEnd } from '~/utils';
import useGetSender from '~/hooks/Conversations/useGetSender';
import { getEndpointField, logger } from '~/utils';
import useUserKey from '~/hooks/Input/useUserKey';
import store from '~/store';
@ -250,7 +250,6 @@ export default function useChatFunctions({
setLatestMessage(initialResponse);
}
scrollToEnd();
setSubmission(submission);
logger.log('Submission:');
logger.dir(submission, { depth: null });

View file

@ -86,7 +86,7 @@ export default function useSubmitMessage(helpers?: { clearDraft?: () => void })
}
const currentText = methods.getValues('text');
const newText = currentText ? `\n${parsedText}` : parsedText;
const newText = currentText?.trim()?.length > 1 ? `\n${parsedText}` : parsedText;
setActivePrompt(newText);
},
[autoSendPrompts, submitMessage, setActivePrompt, methods, user],

View file

@ -19,6 +19,7 @@ import type {
import type { SetterOrUpdater, Resetter } from 'recoil';
import type { TResData, ConvoGenerator } from '~/common';
import {
scrollToEnd,
addConversation,
deleteConversation,
updateConversation,
@ -291,6 +292,8 @@ export default function useEventHandlers({
if (resetLatestMessage) {
resetLatestMessage();
}
scrollToEnd();
},
[setMessages, setConversation, queryClient, isAddedRequest, resetLatestMessage],
);

View file

@ -50,5 +50,5 @@ export const scrollToEnd = () => {
if (messagesEndElement) {
messagesEndElement.scrollIntoView({ behavior: 'instant' });
}
}, 500);
}, 750);
};