mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-22 11:20:15 +01:00
Build/Refactor: lint pre-commit hook and reformat repo to spec (#314)
* build/refactor: move lint/prettier packages to project root, install husky, add pre-commit hook * refactor: reformat files * build: put full eslintrc back with all rules
This commit is contained in:
parent
8d75b25104
commit
7fdc862042
157 changed files with 4836 additions and 2403 deletions
|
|
@ -41,7 +41,9 @@ export default function Message({
|
|||
const { ask, regenerate } = useMessageHandler();
|
||||
const { switchToConversation } = store.useConversation();
|
||||
const blinker = submitting && isSubmitting;
|
||||
const getConversationQuery = useGetConversationByIdQuery(message.conversationId, { enabled: false });
|
||||
const getConversationQuery = useGetConversationByIdQuery(message.conversationId, {
|
||||
enabled: false
|
||||
});
|
||||
|
||||
// debugging
|
||||
// useEffect(() => {
|
||||
|
|
@ -71,9 +73,9 @@ export default function Message({
|
|||
}
|
||||
};
|
||||
|
||||
const getError = text => {
|
||||
const getError = (text) => {
|
||||
const match = text.match(/\{[^{}]*\}/);
|
||||
var json = match ? match[0] : ''
|
||||
var json = match ? match[0] : '';
|
||||
if (isJson(json)) {
|
||||
json = JSON.parse(json);
|
||||
if (json.code === 'invalid_api_key') {
|
||||
|
|
@ -124,7 +126,7 @@ export default function Message({
|
|||
if (!isSubmitting && !message?.isCreatedByUser) regenerate(message);
|
||||
};
|
||||
|
||||
const copyToClipboard = setIsCopied => {
|
||||
const copyToClipboard = (setIsCopied) => {
|
||||
setIsCopied(true);
|
||||
copy(message?.text);
|
||||
|
||||
|
|
@ -135,17 +137,14 @@ export default function Message({
|
|||
|
||||
const clickSearchResult = async () => {
|
||||
if (!searchResult) return;
|
||||
getConversationQuery.refetch(message.conversationId).then(response => {
|
||||
getConversationQuery.refetch(message.conversationId).then((response) => {
|
||||
switchToConversation(response.data);
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<div
|
||||
{...props}
|
||||
onWheel={handleWheel}
|
||||
>
|
||||
<div {...props} onWheel={handleWheel}>
|
||||
<div className="relative m-auto flex gap-4 p-4 text-base md:max-w-2xl md:gap-6 md:py-6 lg:max-w-2xl lg:px-0 xl:max-w-3xl">
|
||||
<div className="relative flex h-[30px] w-[30px] flex-col items-end text-right text-xs md:text-sm">
|
||||
{typeof icon === 'string' && icon.match(/[^\\x00-\\x7F]+/) ? (
|
||||
|
|
@ -197,10 +196,7 @@ export default function Message({
|
|||
>
|
||||
Save & Submit
|
||||
</button>
|
||||
<button
|
||||
className="btn btn-neutral relative"
|
||||
onClick={() => enterEdit(true)}
|
||||
>
|
||||
<button className="btn btn-neutral relative" onClick={() => enterEdit(true)}>
|
||||
Cancel
|
||||
</button>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue