Skip to content

Commit

Permalink
ts error fix (#1256)
Browse files Browse the repository at this point in the history
  • Loading branch information
anastasiya1155 authored Apr 9, 2024
1 parent 3a6b487 commit d797d06
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion client/src/CommandBar/steps/items/RepoItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const RepoItem = ({
const { openFolderInExplorer, os, openLink } = useContext(DeviceContext);

const onRepoSync = useCallback(
async (e?: MouseEvent | KeyboardEvent) => {
async (e?: MouseEvent | KeyboardEvent | React.MouseEvent) => {
e?.preventDefault();
e?.stopPropagation();
await syncRepo(repo.ref);
Expand Down
23 changes: 13 additions & 10 deletions client/src/Project/TutorialCards.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {
import React, {
memo,
useCallback,
useContext,
Expand Down Expand Up @@ -131,15 +131,18 @@ const TutorialCards = ({}: Props) => {
return tabItems.find((i) => i.key === 'explain_file')?.onClick;
}, [tabItems]);

const onBtnClick = useCallback(() => {
if (btnTitle === 'New conversation') {
openNewTab({ type: TabTypesEnum.CHAT });
handleNext();
} else if (btnTitle === 'Explain current file' && explainCurrentFile) {
explainCurrentFile();
handleNext();
}
}, [btnTitle, handleNext, explainCurrentFile]);
const onBtnClick = useCallback(
(e: React.MouseEvent) => {
if (btnTitle === 'New conversation') {
openNewTab({ type: TabTypesEnum.CHAT });
handleNext();
} else if (btnTitle === 'Explain current file' && explainCurrentFile) {
explainCurrentFile(e);
handleNext();
}
},
[btnTitle, handleNext, explainCurrentFile],
);

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

0 comments on commit d797d06

Please sign in to comment.