Skip to content

Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active

fix linter errors

Daniel Avila168d5e8075a0
diff --git a/src/components/main/Message.jsx b/src/components/main/Message.jsx
index f02b71e8b3..4c20a6dcab 100644
--- a/src/components/main/Message.jsx
+++ b/src/components/main/Message.jsx
@@ -2,7 +2,6 @@ import React, { useEffect } from 'react';
import { useSelector } from 'react-redux';
import GPTIcon from '../svg/GPTIcon';
import BingIcon from '../svg/BingIcon';
-// import useCustomEffect from '~/hooks/useCustomEffect';
export default function Message({
sender,
@@ -18,7 +17,7 @@ export default function Message({
if (blinker) {
scrollToBottom();
}
- }, [isSubmitting, text]);
+ }, [isSubmitting, text, blinker, scrollToBottom]);
const props = {
className:
@@ -52,7 +51,7 @@ export default function Message({
</strong>
<div className="relative flex w-[calc(100%-50px)] flex-col gap-1 whitespace-pre-wrap md:gap-3 lg:w-[calc(100%-115px)]">
<div className="flex flex-grow flex-col gap-3">
- {!!error ? (
+ {error ? (
<div className="flex flex min-h-[20px] flex-row flex-col items-start gap-4 gap-2 whitespace-pre-wrap text-red-500">
<div className="rounded-md border border-red-500 bg-red-500/10 py-2 px-3 text-sm text-gray-600 dark:text-gray-100">
{text}
diff --git a/src/components/main/Messages.jsx b/src/components/main/Messages.jsx
index 040d7d0e92..673fb2c42e 100644
--- a/src/components/main/Messages.jsx
+++ b/src/components/main/Messages.jsx
@@ -63,7 +63,7 @@ const Messages = ({ messages }) => {
sender={message.sender}
text={message.text}
last={i === messages.length - 1}
- error={!!message.error ? true : false}
+ error={message.error ? true : false}
scrollToBottom={i === messages.length - 1 ? scrollToBottom : null}
/>
))}
@@ -74,7 +74,7 @@ const Messages = ({ messages }) => {
unmountOnExit={false}
// appear
>
- {(state) => showScrollButton && <ScrollToBottom scrollHandler={scrollHandler} />}
+ {() => showScrollButton && <ScrollToBottom scrollHandler={scrollHandler} />}
</CSSTransition>
<div
diff --git a/src/components/main/ModelMenu.jsx b/src/components/main/ModelMenu.jsx
index 5b24d004ae..4df9335525 100644
--- a/src/components/main/ModelMenu.jsx
+++ b/src/components/main/ModelMenu.jsx
@@ -1,14 +1,12 @@
-import React, { useState } from 'react';
+import React from 'react';
import { useSelector, useDispatch } from 'react-redux';
import { setModel } from '~/store/submitSlice';
import GPTIcon from '../svg/GPTIcon';
import BingIcon from '../svg/BingIcon';
-import { DropdownMenuCheckboxItemProps } from '@radix-ui/react-dropdown-menu';
import { Button } from '../ui/Button.tsx';
import {
DropdownMenu,
- DropdownMenuCheckboxItem,
DropdownMenuContent,
DropdownMenuLabel,
DropdownMenuRadioGroup,
diff --git a/src/components/main/ScrollToBottom.jsx b/src/components/main/ScrollToBottom.jsx
index 3a34377229..c0d85367eb 100644
--- a/src/components/main/ScrollToBottom.jsx
+++ b/src/components/main/ScrollToBottom.jsx
@@ -1,5 +1,4 @@
import React from 'react';
-import { CSSTransition } from 'react-transition-group';
export default function ScrollToBottom({ scrollHandler}) {
diff --git a/src/components/main/SubmitButton.jsx b/src/components/main/SubmitButton.jsx
index d37c90270a..54bfdd95e6 100644
--- a/src/components/main/SubmitButton.jsx
+++ b/src/components/main/SubmitButton.jsx
@@ -1,6 +1,5 @@
import React from 'react';
import { useSelector } from 'react-redux';
-import useDidMountEffect from '~/hooks/useDidMountEffect';
export default function SubmitButton({ submitMessage }) {
const { isSubmitting } = useSelector((state) => state.submit);
diff --git a/src/components/main/TextChat.jsx b/src/components/main/TextChat.jsx
index 9dd47259cf..53ed0e2f29 100644
--- a/src/components/main/TextChat.jsx
+++ b/src/components/main/TextChat.jsx
@@ -20,7 +20,7 @@ export default function TextChat({ messages }) {
const { error } = convo;
const submitMessage = () => {
- if (!!error) {
+ if (error) {
dispatch(setError(false));
}
@@ -116,7 +116,7 @@ export default function TextChat({ messages }) {
}
if (e.key === 'Enter' && !e.shiftKey) {
- if (!!isSubmitting) {
+ if (isSubmitting) {
return;
}
@@ -142,7 +142,7 @@ export default function TextChat({ messages }) {
<form className="stretch mx-2 flex flex-row gap-3 pt-2 last:mb-2 md:last:mb-6 lg:mx-auto lg:max-w-3xl lg:pt-6">
<div className="relative flex h-full flex-1 md:flex-col">
<div className="ml-1 mt-1.5 flex justify-center gap-0 md:m-auto md:mb-2 md:w-full md:gap-2" />
- {!!error ? (
+ {error ? (
<Regenerate
submitMessage={submitMessage}
tryAgain={tryAgain}