Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: [#5792] 新增消息时还原设置按钮 #5803

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/components/chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -956,6 +956,10 @@ function _Chat() {
const [attachImages, setAttachImages] = useState<string[]>([]);
const [uploading, setUploading] = useState(false);

useEffect(() => {
setHitBottom(true);
}, [session.messages]);
Comment on lines +959 to +961
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Rename _Chat component to follow React naming conventions.

The component name should start with an uppercase letter to follow React's component naming conventions and resolve the static analysis warning.

Apply this diff to fix the naming:

-function _Chat() {
+function Chat() {
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
useEffect(() => {
setHitBottom(true);
}, [session.messages]);
function Chat() {
useEffect(() => {
setHitBottom(true);
}, [session.messages]);
🧰 Tools
🪛 eslint

[error] 959-959: React Hook "useEffect" is called in function "_Chat" that is neither a React function component nor a custom React Hook function. React component names must start with an uppercase letter. React Hook names must start with the word "use".

(react-hooks/rules-of-hooks)


// prompt hints
const promptStore = usePromptStore();
const [promptHints, setPromptHints] = useState<RenderPrompt[]>([]);
Expand Down
Loading