From 6a04a1a05301894a3d850135ac17ed9c24b045ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Daubensch=C3=BCtz?= Date: Tue, 14 Jul 2015 20:10:41 +0200 Subject: [PATCH] fix fineuploader issue after unmounting react-s3-fineuploader --- js/components/ascribe_uploader/react_s3_fine_uploader.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/js/components/ascribe_uploader/react_s3_fine_uploader.js b/js/components/ascribe_uploader/react_s3_fine_uploader.js index b9ef09fc..9d60e3ba 100644 --- a/js/components/ascribe_uploader/react_s3_fine_uploader.js +++ b/js/components/ascribe_uploader/react_s3_fine_uploader.js @@ -163,6 +163,13 @@ var ReactS3FineUploader = React.createClass({ } }, + componentWillUnmount() { + // Without this method, fineuploader will continue to try to upload artworks + // even though this component is not mounted any more. + // Therefore we cancel all uploads + this.state.uploader.cancelAll(); + }, + propsToConfig() { let objectProperties = this.props.objectProperties; objectProperties.key = this.requestKey;