Просмотр исходного кода

fix condition

thanks @benjamin-demarteau, this should be enough, right? worked for me in tests
Artur Paikin 7 лет назад
Родитель
Сommit
32b24c75db

+ 1 - 1
src/plugins/Dashboard/ActionBrowseTagline.js

@@ -28,7 +28,7 @@ class ActionBrowseTagline extends Component {
           tabindex="-1"
           tabindex="-1"
           type="file"
           type="file"
           name="files[]"
           name="files[]"
-          multiple={this.props.maxNumberOfFiles !== 1 || !this.props.maxNumberOfFiles}
+          multiple={this.props.maxNumberOfFiles !== 1}
           onchange={this.props.handleInputChange}
           onchange={this.props.handleInputChange}
           accept={this.props.allowedFileTypes}
           accept={this.props.allowedFileTypes}
           value=""
           value=""

+ 1 - 1
src/plugins/Dashboard/Tabs.js

@@ -49,7 +49,7 @@ class Tabs extends Component {
             tabindex="-1"
             tabindex="-1"
             type="file"
             type="file"
             name="files[]"
             name="files[]"
-            multiple={this.props.maxNumberOfFiles !== 1 || !this.props.maxNumberOfFiles}
+            multiple={this.props.maxNumberOfFiles !== 1}
             accept={this.props.allowedFileTypes}
             accept={this.props.allowedFileTypes}
             onchange={this.props.handleInputChange}
             onchange={this.props.handleInputChange}
             value=""
             value=""

+ 1 - 1
src/plugins/DragDrop/index.js

@@ -128,7 +128,7 @@ module.exports = class DragDrop extends Plugin {
               class="uppy-DragDrop-input"
               class="uppy-DragDrop-input"
               type="file"
               type="file"
               name="files[]"
               name="files[]"
-              multiple={restrictions.maxNumberOfFiles !== 1 || !restrictions.maxNumberOfFiles}
+              multiple={restrictions.maxNumberOfFiles !== 1}
               accept={restrictions.allowedFileTypes}
               accept={restrictions.allowedFileTypes}
               ref={(input) => {
               ref={(input) => {
                 this.input = input
                 this.input = input

+ 1 - 1
src/plugins/FileInput.js

@@ -78,7 +78,7 @@ module.exports = class FileInput extends Plugin {
         type="file"
         type="file"
         name={this.opts.inputName}
         name={this.opts.inputName}
         onchange={this.handleInputChange}
         onchange={this.handleInputChange}
-        multiple={restrictions.maxNumberOfFiles !== 1 || !restrictions.maxNumberOfFiles}
+        multiple={restrictions.maxNumberOfFiles !== 1}
         accept={restrictions.allowedFileTypes}
         accept={restrictions.allowedFileTypes}
         ref={(input) => { this.input = input }} />
         ref={(input) => { this.input = input }} />
       {this.opts.pretty &&
       {this.opts.pretty &&