Skip to content
This repository was archived by the owner on Jan 2, 2025. It is now read-only.

Commit d797d06

Browse files
ts error fix (#1256)
1 parent 3a6b487 commit d797d06

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

client/src/CommandBar/steps/items/RepoItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const RepoItem = ({
6666
const { openFolderInExplorer, os, openLink } = useContext(DeviceContext);
6767

6868
const onRepoSync = useCallback(
69-
async (e?: MouseEvent | KeyboardEvent) => {
69+
async (e?: MouseEvent | KeyboardEvent | React.MouseEvent) => {
7070
e?.preventDefault();
7171
e?.stopPropagation();
7272
await syncRepo(repo.ref);

client/src/Project/TutorialCards.tsx

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {
1+
import React, {
22
memo,
33
useCallback,
44
useContext,
@@ -131,15 +131,18 @@ const TutorialCards = ({}: Props) => {
131131
return tabItems.find((i) => i.key === 'explain_file')?.onClick;
132132
}, [tabItems]);
133133

134-
const onBtnClick = useCallback(() => {
135-
if (btnTitle === 'New conversation') {
136-
openNewTab({ type: TabTypesEnum.CHAT });
137-
handleNext();
138-
} else if (btnTitle === 'Explain current file' && explainCurrentFile) {
139-
explainCurrentFile();
140-
handleNext();
141-
}
142-
}, [btnTitle, handleNext, explainCurrentFile]);
134+
const onBtnClick = useCallback(
135+
(e: React.MouseEvent) => {
136+
if (btnTitle === 'New conversation') {
137+
openNewTab({ type: TabTypesEnum.CHAT });
138+
handleNext();
139+
} else if (btnTitle === 'Explain current file' && explainCurrentFile) {
140+
explainCurrentFile(e);
141+
handleNext();
142+
}
143+
},
144+
[btnTitle, handleNext, explainCurrentFile],
145+
);
143146

144147
return (
145148
<div className="absolute right-0 bottom-0 px-8 py-8 w-full max-w-[26rem] select-none">

0 commit comments

Comments
 (0)