diff options
Diffstat (limited to 'src/components/ui/ImageUpload.js')
-rw-r--r-- | src/components/ui/ImageUpload.js | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/components/ui/ImageUpload.js b/src/components/ui/ImageUpload.js index 059610aec..bb4ea0565 100644 --- a/src/components/ui/ImageUpload.js +++ b/src/components/ui/ImageUpload.js | |||
@@ -26,16 +26,13 @@ export default @observer class ImageUpload extends Component { | |||
26 | 26 | ||
27 | dropzoneRef = null; | 27 | dropzoneRef = null; |
28 | 28 | ||
29 | imgPath = null; | ||
30 | |||
31 | onDrop(acceptedFiles) { | 29 | onDrop(acceptedFiles) { |
32 | const { field } = this.props; | 30 | const { field } = this.props; |
33 | 31 | ||
34 | acceptedFiles.forEach((file) => { | 32 | acceptedFiles.forEach((file) => { |
35 | this.imgPath = isWindows ? file.path.replace(/\\/g, '/') : file.path; | 33 | const imgPath = isWindows ? file.path.replace(/\\/g, '/') : file.path; |
36 | |||
37 | this.setState({ | 34 | this.setState({ |
38 | path: this.imgPath, | 35 | path: imgPath, |
39 | }); | 36 | }); |
40 | 37 | ||
41 | this.props.field.onDrop(file); | 38 | this.props.field.onDrop(file); |