Skip to content

Commit

Permalink
Merge branch 'main' into fix-social-share-image-url
Browse files Browse the repository at this point in the history
  • Loading branch information
clostao authored Feb 4, 2025
2 parents 45813e4 + 5050143 commit 0a8fe89
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions frontend/src/components/common/FileTable/FileTableRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,10 @@ export const FileTableRow = ({
[onRestoreFile, file.headCid, stopEventPropagation],
);
const handleToggleSelectFile = useMemo(
() =>
stopEventPropagation<React.MouseEvent<HTMLInputElement>>(() =>
toggleSelectFile(file.headCid),
),
[toggleSelectFile, file.headCid, stopEventPropagation],
() => (headCid: string) => {
toggleSelectFile(headCid);
},
[],
);

const toggleExpand = useCallback(() => setIsRowExpanded((prev) => !prev), []);
Expand All @@ -129,7 +128,7 @@ export const FileTableRow = ({
type='checkbox'
readOnly={true}
checked={selectedFiles.some((cid) => cid === file.headCid)}
onClick={handleToggleSelectFile}
onChange={() => handleToggleSelectFile(file.headCid)}
className='mr-3 rounded border-gray-300 text-blue-600 focus:ring-blue-500'
/>
{file.type === 'folder' && file.children && (
Expand Down Expand Up @@ -278,9 +277,7 @@ export const FileTableRow = ({
<TableBodyCell className='w-[50%]'>
<div className='flex items-center'>
<input
onClick={stopEventPropagation(() =>
toggleSelectFile(child.cid),
)}
onChange={() => toggleSelectFile(child.cid)}
readOnly={true}
checked={selectedFiles.some((f) => f === child.cid)}
type='checkbox'
Expand Down

0 comments on commit 0a8fe89

Please sign in to comment.