Skip to content

Commit

Permalink
Desktop: Fix dropping files into the editor
Browse files Browse the repository at this point in the history
  • Loading branch information
personalizedrefrigerator committed Nov 11, 2024
1 parent 3887010 commit a2da5f2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/app-desktop/gui/NoteEditor/utils/useDropHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 = {
Expand Down

0 comments on commit a2da5f2

Please sign in to comment.