@capillarytech/creatives-library 2.0.51 → 2.0.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -93,36 +93,36 @@ export class EmailWrapper extends React.Component { // eslint-disable-line react
93
93
  CapNotification.error(message);
94
94
  }
95
95
  handleFileUpload = (file) => {
96
- const { templatesActions, intl, showNextStep } = this.props;
97
- const validUpload = false;
98
- const fileExtension = file.name.split('.').pop();
99
- const supportedZipFormats = ['zip'];
96
+ const { templatesActions, intl, showNextStep, isUploading } = this.props;
97
+ if (!isUploading) {
98
+ const fileExtension = file.name.split('.').pop();
99
+ const supportedZipFormats = ['zip'];
100
100
 
101
101
 
102
- if (supportedZipFormats.indexOf(fileExtension.toLowerCase()) !== -1) {
103
- templatesActions.handleZipUpload(file.originFileObj, () => { //handle upload success
104
- this.setState({modeContent: { file}}, showNextStep);
105
- }, this.handleZipUploadError);
106
- } else if (fileExtension === 'html' || fileExtension === 'htm') {
107
- const reader = new FileReader();
108
- reader.onload = () => {
109
- const text = reader.result;
110
- this.setState({modeContent: { file}}, () => {
111
- templatesActions.handleHtmlUpload(text);
112
- });
102
+ if (supportedZipFormats.indexOf(fileExtension.toLowerCase()) !== -1) {
103
+ templatesActions.handleZipUpload(file.originFileObj, () => { //handle upload success
104
+ this.setState({modeContent: { file}}, showNextStep);
105
+ }, this.handleZipUploadError);
106
+ } else if (fileExtension === 'html' || fileExtension === 'htm') {
107
+ const reader = new FileReader();
108
+ reader.onload = () => {
109
+ const text = reader.result;
110
+ this.setState({modeContent: { file}}, () => {
111
+ templatesActions.handleHtmlUpload(text);
112
+ });
113
113
 
114
- // showNextStep();
115
- };
116
- reader.readAsText(file.originFileObj);
117
- } else {
118
- const message = {
119
- key: "email-upload-error",
120
- message: intl.formatMessage(messages.invalidUploadFileError),
121
- description: intl.formatMessage(messages.invalidUploadFileErrorDesc),
122
- };
123
- CapNotification.error(message);
114
+ // showNextStep();
115
+ };
116
+ reader.readAsText(file.originFileObj);
117
+ } else {
118
+ const message = {
119
+ key: "email-upload-error",
120
+ message: intl.formatMessage(messages.invalidUploadFileError),
121
+ description: intl.formatMessage(messages.invalidUploadFileErrorDesc),
122
+ };
123
+ CapNotification.error(message);
124
+ }
124
125
  }
125
- return validUpload;
126
126
  };
127
127
 
128
128
  handleEdmDefaultTemplateSelection = (id) => {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "2.0.51",
4
+ "version": "2.0.52",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",