lintering

This commit is contained in:
FTCHD
2026-02-03 16:00:50 +07:00
parent 656917847a
commit a4fb9b45da
2 changed files with 5 additions and 22 deletions
+3 -5
View File
@@ -127,6 +127,7 @@ const FilePanel = forwardRef<
}
}, [onDrop, nav.selectedRemote, nav.cwd])
// biome-ignore lint/correctness/useExhaustiveDependencies: <>
useEffect(() => {
if (onSelectionChange) {
onSelectionChange(nav.getSelection())
@@ -253,10 +254,6 @@ const FilePanel = forwardRef<
[onDrop]
)
const handleContextMenu = useCallback((entry: Entry, event: React.MouseEvent) => {
// Context menu is handled at the Browser level
}, [])
const handlePreviewClick = useCallback(
(entry: Entry) => {
if (entry.isDir) return
@@ -328,7 +325,8 @@ const FilePanel = forwardRef<
onDownload={onDownload}
draggable={selectionMode === 'drag' || selectionMode === 'both'}
onDragStart={handleDragStartInternal}
onContextMenu={contextMenuItems ? handleContextMenu : undefined}
// handled at the Browser level
onContextMenu={contextMenuItems ? () => {} : undefined}
favoritedKeys={nav.favoritedKeys}
onToggleFavorite={handleToggleFavorite}
listHeight={listHeight}
+2 -17
View File
@@ -229,28 +229,13 @@ export default function Browser() {
</DropdownTrigger>
<DropdownMenu
onAction={(key) => {
if (key === 'preview' && !contextMenu.entry.isDir) {
setPreviewItem(contextMenu.entry)
} else if (key === 'copy-path') {
if (key === 'copy-path') {
navigator.clipboard.writeText(contextMenu.entry.fullPath)
} else if (key === 'info') {
setPreviewItem(contextMenu.entry)
}
closeContextMenu()
}}
>
{contextMenu.entry.isDir ? (
<>
<DropdownItem key="copy-path">Copy Path</DropdownItem>
<DropdownItem key="info">Get Info</DropdownItem>
</>
) : (
<>
<DropdownItem key="preview">Preview</DropdownItem>
<DropdownItem key="copy-path">Copy Path</DropdownItem>
<DropdownItem key="info">Get Info</DropdownItem>
</>
)}
<DropdownItem key="copy-path">Copy Path</DropdownItem>
</DropdownMenu>
</Dropdown>
</div>