Skip to content

Commit 912d949

Browse files
authored
Update react-dropzone; Fix an error (#357)
* Update react-dropzone * Downgrade react-dropzone * Fix an error with files being dropped into the dropzone
1 parent ba76875 commit 912d949

3 files changed

Lines changed: 24 additions & 13 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
"prop-types": "^15.8.1",
9090
"react": "^18.3.1",
9191
"react-dom": "^18.3.1",
92-
"react-dropzone": "^14.2.3",
92+
"react-dropzone": "14.2.10",
9393
"react-scripts": "^5.0.1",
9494
"react-split-pane": "^0.1.92",
9595
"serialize-error": "^8.1.0",

src/app/Input.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ import Box from '@mui/material/Box';
1010
import TreeCard from './TreeCard';
1111
import { Typography } from '@mui/material';
1212
import Dropzone from 'react-dropzone';
13+
import { webUtils } from 'electron';
1314

14-
const useStyles = makeStyles(theme => ({
15+
const useStyles = makeStyles((theme) => ({
1516
Input: {
1617
width: '100%',
1718
},
@@ -91,7 +92,6 @@ const useStyles = makeStyles(theme => ({
9192
transform: 'translateZ(0)',
9293
width: 500,
9394
},
94-
9595
}));
9696

9797
const Input = ({ run }) => {
@@ -113,7 +113,14 @@ const Input = ({ run }) => {
113113
>
114114
<Dropzone
115115
noClick
116-
onDrop={(acceptedFiles) => run.addAlignments(acceptedFiles)}
116+
onDrop={(acceptedFiles) => {
117+
const droppedPathes = acceptedFiles.map((file) => {
118+
return {
119+
path: webUtils.getPathForFile(file),
120+
};
121+
});
122+
run.addAlignments(droppedPathes);
123+
}}
117124
>
118125
{({ getRootProps, getInputProps }) => (
119126
<div {...getRootProps()}>
@@ -269,7 +276,6 @@ const Input = ({ run }) => {
269276
// { run.ok ? null : run.missing }
270277
// </Box>
271278

272-
273279
Input.propTypes = {
274280
run: PropTypes.object.isRequired,
275281
};

yarn.lock

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3712,9 +3712,9 @@ atomically@^1.7.0:
37123712
integrity sha512-Xcz9l0z7y9yQ9rdDaxlmaI4uJHf/T8g9hOEzJcsEqX2SjCj4J20uK7+ldkDHMbpJDK76wF7xEIgxc/vSlsfw5w==
37133713

37143714
attr-accept@^2.2.2:
3715-
version "2.2.2"
3716-
resolved "https://registry.yarnpkg.com/attr-accept/-/attr-accept-2.2.2.tgz#646613809660110749e92f2c10833b70968d929b"
3717-
integrity sha512-7prDjvt9HmqiZ0cl5CRjtS84sEyhsHP2coDkaZKRKVfCDo9s7iw7ChVmar78Gu9pC4SoR/28wFu/G5JJhTnqEg==
3715+
version "2.2.5"
3716+
resolved "https://registry.yarnpkg.com/attr-accept/-/attr-accept-2.2.5.tgz#d7061d958e6d4f97bf8665c68b75851a0713ab5e"
3717+
integrity sha512-0bDNnY/u6pPwHDMoF0FieU354oBi0a8rD9FcsLwzcGWbc8KS8KPIi7y+s13OlVY+gMWc/9xEMUgNE6Qm8ZllYQ==
37183718

37193719
autoprefixer@^10.4.12, autoprefixer@^10.4.13:
37203720
version "10.4.20"
@@ -11764,10 +11764,10 @@ react-dom@^18.3.1:
1176411764
loose-envify "^1.1.0"
1176511765
scheduler "^0.23.2"
1176611766

11767-
react-dropzone@^14.2.3:
11768-
version "14.2.3"
11769-
resolved "https://registry.yarnpkg.com/react-dropzone/-/react-dropzone-14.2.3.tgz#0acab68308fda2d54d1273a1e626264e13d4e84b"
11770-
integrity sha512-O3om8I+PkFKbxCukfIR3QAGftYXDZfOE2N1mr/7qebQJHs7U+/RSL/9xomJNpRg9kM5h9soQSdf0Gc7OHF5Fug==
11767+
react-dropzone@14.2.10:
11768+
version "14.2.10"
11769+
resolved "https://registry.yarnpkg.com/react-dropzone/-/react-dropzone-14.2.10.tgz#b8d86775c616534b44a30bd9c962044d2925c1a2"
11770+
integrity sha512-Y98LOCYxGO2jOFWREeKJlL7gbrHcOlTBp+9DCM1dh9XQ8+P/8ThhZT7kFb05C+bPcTXq/rixpU+5+LzwYrFLUw==
1177111771
dependencies:
1177211772
attr-accept "^2.2.2"
1177311773
file-selector "^0.6.0"
@@ -13836,11 +13836,16 @@ tslib@^1.8.1:
1383613836
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00"
1383713837
integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==
1383813838

13839-
tslib@^2.0.3, tslib@^2.1.0, tslib@^2.4.0, tslib@^2.5.0:
13839+
tslib@^2.0.3, tslib@^2.1.0, tslib@^2.5.0:
1384013840
version "2.7.0"
1384113841
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.7.0.tgz#d9b40c5c40ab59e8738f297df3087bf1a2690c01"
1384213842
integrity sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==
1384313843

13844+
tslib@^2.4.0:
13845+
version "2.8.1"
13846+
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.8.1.tgz#612efe4ed235d567e8aba5f2a5fab70280ade83f"
13847+
integrity sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==
13848+
1384413849
tsutils@^3.21.0:
1384513850
version "3.21.0"
1384613851
resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623"

0 commit comments

Comments
 (0)