diff --git a/src/renderer/src/components/right-sidebar/useFileExplorerRowDrag.ts b/src/renderer/src/components/right-sidebar/useFileExplorerRowDrag.ts index 565f7cd96..30cb629df 100644 --- a/src/renderer/src/components/right-sidebar/useFileExplorerRowDrag.ts +++ b/src/renderer/src/components/right-sidebar/useFileExplorerRowDrag.ts @@ -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')