ui-kit-ck-consultant 0.5.187 → 0.5.188

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.
package/dist/index.js CHANGED
@@ -3058,29 +3058,36 @@ var DropzoneMultiple = /*#__PURE__*/function (_React$Component) {
3058
3058
  var name = file.name.split('.');
3059
3059
 
3060
3060
  if (_this.checkExtension(name[name.length - 1])) {
3061
- var reader = new window.FileReader();
3061
+ if (!_this.props.maxFileSize || _this.props.maxFileSize * 1000000 > file.size) {
3062
+ var reader = new window.FileReader();
3063
+
3064
+ reader.onload = function () {
3065
+ var base64 = reader.result;
3066
+ var tmpFiles = _this.state.files;
3067
+ tmpFiles.push({
3068
+ base64: base64,
3069
+ mime: file.type,
3070
+ name: file.name,
3071
+ extension: name[name.length - 1],
3072
+ size: file.size
3073
+ });
3062
3074
 
3063
- reader.onload = function () {
3064
- var base64 = reader.result;
3065
- var tmpFiles = _this.state.files;
3066
- tmpFiles.push({
3067
- base64: base64,
3068
- mime: file.type,
3069
- name: file.name,
3070
- extension: name[name.length - 1],
3071
- size: file.size
3072
- });
3075
+ _this.setState({
3076
+ files: tmpFiles
3077
+ }, function () {
3078
+ _this.currentFile += 1;
3073
3079
 
3074
- _this.setState({
3075
- files: tmpFiles
3076
- }, function () {
3077
- _this.currentFile += 1;
3080
+ _this.nextFile(files);
3081
+ });
3082
+ };
3078
3083
 
3079
- _this.nextFile(files);
3080
- });
3081
- };
3084
+ reader.readAsDataURL(file);
3085
+ } else {
3086
+ alert('Fichier trop volumineux');
3087
+ _this.currentFile += 1;
3082
3088
 
3083
- reader.readAsDataURL(file);
3089
+ _this.nextFile(files);
3090
+ }
3084
3091
  } else {
3085
3092
  _this.currentFile += 1;
3086
3093