From 1e14f28db0cfc9cd18beb609de8d894df2d239af Mon Sep 17 00:00:00 2001 From: Vijay A Date: Mon, 19 Jul 2021 07:31:06 +0530 Subject: Minor refactoring to avoid leaking of objects. --- src/components/ui/ImageUpload.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src') 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 { dropzoneRef = null; - imgPath = null; - onDrop(acceptedFiles) { const { field } = this.props; acceptedFiles.forEach((file) => { - this.imgPath = isWindows ? file.path.replace(/\\/g, '/') : file.path; - + const imgPath = isWindows ? file.path.replace(/\\/g, '/') : file.path; this.setState({ - path: this.imgPath, + path: imgPath, }); this.props.field.onDrop(file); -- cgit v1.2.3-70-g09d2