Skip to content

Commit

Permalink
Fix DnD (#480)
Browse files Browse the repository at this point in the history
  • Loading branch information
KievDevel authored Oct 23, 2024
1 parent d037c68 commit ee20dc6
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/components/ControlPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
Toggle,
truncateMiddle,
} from '@nordicsemiconductor/pc-nrfconnect-shared';
import { webUtils } from 'electron';

import * as fileActions from '../actions/fileActions';
import * as jlinkTargetActions from '../actions/jlinkTargetActions';
Expand Down Expand Up @@ -58,12 +59,10 @@ const useRegisterDragEvents = () => {

// eslint-disable-next-line no-restricted-syntax
for (const file of event.dataTransfer.files) {
const path = webUtils.getPathForFile(file);

// eslint-disable-next-line no-await-in-loop
await dispatch(
fileActions.openFile(
(file as unknown as { path: string }).path
)
);
await dispatch(fileActions.openFile(path));
}
};

Expand Down

0 comments on commit ee20dc6

Please sign in to comment.