Skip to content

Commit 348a1f1

Browse files
committed
feat: solve build error
1 parent b095f23 commit 348a1f1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

fe_repo/src/pages/ChatBox.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,10 @@ export const ChatBox = ({onSendMessage}: IChatBoxProps) => {
3636
style={{width: '64px', display: 'flex', justifyContent: 'center', cursor: 'pointer'}}
3737
onClick={() => {
3838
// Upload files
39-
const handleFiles = (event) => {
40-
if (!event.target?.files) return;
41-
const file = event.target.files[0];
39+
const handleFiles = (event: Event) => {
40+
const files = (event.target as HTMLInputElement)?.files;
41+
if (!files || files.length === 0) return;
42+
const file = files[0];
4243
if (file) {
4344
// upload if file is valid
4445
uploadFile(file);

0 commit comments

Comments
 (0)