소스 검색

fix: type error

DDMeaqua 1 년 전
부모
커밋
7804182d0d
1개의 변경된 파일3개의 추가작업 그리고 2개의 파일을 삭제
  1. 3 2
      app/components/chat.tsx

+ 3 - 2
app/components/chat.tsx

@@ -1428,7 +1428,7 @@ function _Chat() {
   const [showShortcutKeyModal, setShowShortcutKeyModal] = useState(false);
 
   useEffect(() => {
-    const handleKeyDown = (event) => {
+    const handleKeyDown = (event: any) => {
       // 打开新聊天 command + shift + o
       if (
         (event.metaKey || event.ctrlKey) &&
@@ -1453,7 +1453,8 @@ function _Chat() {
         event.code === "Semicolon"
       ) {
         event.preventDefault();
-        const copyCodeButton = document.querySelectorAll(".copy-code-button");
+        const copyCodeButton =
+          document.querySelectorAll<HTMLElement>(".copy-code-button");
         if (copyCodeButton.length > 0) {
           copyCodeButton[copyCodeButton.length - 1].click();
         }