mirror of
https://github.com/langgenius/webapp-conversation.git
synced 2025-12-19 12:06:38 +08:00
feat: migrate ESLint to v9 flat config
- Replace .eslintrc.json with eslint.config.mjs - Simplify configuration using @antfu/eslint-config - Add necessary ESLint plugin dependencies - Disable overly strict style rules - Set package.json type to module for ESM support - Fix ESLint disable comment format 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@ -19,7 +19,7 @@ import FileUploaderInAttachmentWrapper from '@/app/components/base/file-uploader
|
||||
import type { FileEntity, FileUpload } from '@/app/components/base/file-uploader-in-attachment/types'
|
||||
import { getProcessedFiles } from '@/app/components/base/file-uploader-in-attachment/utils'
|
||||
|
||||
export type IChatProps = {
|
||||
export interface IChatProps {
|
||||
chatList: ChatItem[]
|
||||
/**
|
||||
* Whether to display the editing area and rating status
|
||||
@ -97,8 +97,7 @@ const Chat: FC<IChatProps> = ({
|
||||
const [attachmentFiles, setAttachmentFiles] = React.useState<FileEntity[]>([])
|
||||
|
||||
const handleSend = () => {
|
||||
if (!valid() || (checkCanSend && !checkCanSend()))
|
||||
return
|
||||
if (!valid() || (checkCanSend && !checkCanSend())) { return }
|
||||
const imageFiles: VisionFile[] = files.filter(file => file.progress !== -1).map(fileItem => ({
|
||||
type: 'image',
|
||||
transfer_method: fileItem.type,
|
||||
@ -109,23 +108,20 @@ const Chat: FC<IChatProps> = ({
|
||||
const combinedFiles: VisionFile[] = [...imageFiles, ...docAndOtherFiles]
|
||||
onSend(queryRef.current, combinedFiles)
|
||||
if (!files.find(item => item.type === TransferMethod.local_file && !item.fileId)) {
|
||||
if (files.length)
|
||||
onClear()
|
||||
if (files.length) { onClear() }
|
||||
if (!isResponding) {
|
||||
setQuery('')
|
||||
queryRef.current = ''
|
||||
}
|
||||
}
|
||||
if (!attachmentFiles.find(item => item.transferMethod === TransferMethod.local_file && !item.uploadedId))
|
||||
setAttachmentFiles([])
|
||||
if (!attachmentFiles.find(item => item.transferMethod === TransferMethod.local_file && !item.uploadedId)) { setAttachmentFiles([]) }
|
||||
}
|
||||
|
||||
const handleKeyUp = (e: any) => {
|
||||
if (e.code === 'Enter') {
|
||||
e.preventDefault()
|
||||
// prevent send message when using input method enter
|
||||
if (!e.shiftKey && !isUseInputMethod.current)
|
||||
handleSend()
|
||||
if (!e.shiftKey && !isUseInputMethod.current) { handleSend() }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user