Browse Source

fix the issue with FileCard rendering 0 in place of edit button, because props.metaFields.length

fixed by checking props.metaFields.length > 0, which returns true/false instead of 0
thanks @goto-bus-stop! //cc @lakesare
Artur Paikin 5 years ago
parent
commit
1d8ee14ead
1 changed files with 1 additions and 1 deletions
  1. 1 1
      packages/@uppy/dashboard/src/components/FileItem/Buttons/index.js

+ 1 - 1
packages/@uppy/dashboard/src/components/FileItem/Buttons/index.js

@@ -6,7 +6,7 @@ const { iconPencil, iconCross, iconCopyLink } = require('../../icons')
 const renderEditButton = (props) => (
   !props.uploadInProgressOrComplete &&
   props.metaFields &&
-  props.metaFields.length &&
+  props.metaFields.length > 0 &&
   <button
     class="uppy-u-reset uppy-DashboardItem-action uppy-DashboardItem-action--edit"
     type="button"