Skip to content

Commit ee20dc6

Browse files
authored
Fix DnD (#480)
1 parent d037c68 commit ee20dc6

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/components/ControlPanel.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import {
2121
Toggle,
2222
truncateMiddle,
2323
} from '@nordicsemiconductor/pc-nrfconnect-shared';
24+
import { webUtils } from 'electron';
2425

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

5960
// eslint-disable-next-line no-restricted-syntax
6061
for (const file of event.dataTransfer.files) {
62+
const path = webUtils.getPathForFile(file);
63+
6164
// eslint-disable-next-line no-await-in-loop
62-
await dispatch(
63-
fileActions.openFile(
64-
(file as unknown as { path: string }).path
65-
)
66-
);
65+
await dispatch(fileActions.openFile(path));
6766
}
6867
};
6968

0 commit comments

Comments
 (0)