fix: clear file row drag expand timers (#3501)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import React, { useCallback, useRef } from 'react'
|
||||
import React, { useCallback, useEffect, useRef } from 'react'
|
||||
import { getWorkspaceFileDragPaths, WORKSPACE_FILE_PATH_MIME } from '@/lib/workspace-file-drag'
|
||||
|
||||
const DRAG_EXPAND_DELAY_MS = 500
|
||||
@@ -52,6 +52,13 @@ export function useFileExplorerRowDrag({
|
||||
}
|
||||
}, [])
|
||||
|
||||
useEffect(() => {
|
||||
return () => {
|
||||
clearExpandTimer()
|
||||
clearNativeExpandTimer()
|
||||
}
|
||||
}, [clearExpandTimer, clearNativeExpandTimer])
|
||||
|
||||
const handleDragOver = useCallback((e: React.DragEvent) => {
|
||||
const isInternal = e.dataTransfer.types.includes(WORKSPACE_FILE_PATH_MIME)
|
||||
const isNative = e.dataTransfer.types.includes('Files')
|
||||
|
||||
Reference in New Issue
Block a user