1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-10-31 00:07:48 +02:00

Desktop: Fix dropping files into the editor (#11380)

This commit is contained in:
Henry Heino
2024-11-13 02:06:48 -08:00
committed by GitHub
parent 226a8b3813
commit 0fadf1b0be

View File

@@ -2,6 +2,7 @@ import { useCallback } from 'react';
import Note from '@joplin/lib/models/Note';
import { DragEvent as ReactDragEvent } from 'react';
import { DropCommandValue } from './types';
import { webUtils } from 'electron';
interface HookDependencies {
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied
@@ -56,8 +57,9 @@ export default function useDropHandler(dependencies: HookDependencies): DropHand
const paths = [];
for (let i = 0; i < files.length; i++) {
const file = files[i];
if (!file.path) continue;
paths.push(file.path);
const path = webUtils.getPathForFile(file);
if (!path) continue;
paths.push(path);
}
const props: DropCommandValue = {