mirror of
https://github.com/laurent22/joplin.git
synced 2025-01-23 18:53:36 +02:00
Desktop: Fix dropping files into the editor (#11380)
This commit is contained in:
parent
226a8b3813
commit
0fadf1b0be
@ -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 = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user