瀏覽代碼

@uppy/core: fix metafields validation when used as function (#4276)

Merlijn Vos 2 年之前
父節點
當前提交
9d4d21955a

+ 2 - 0
packages/@uppy/dashboard/src/components/FileItem/FileInfo/index.scss

@@ -88,7 +88,9 @@
 }
 
 .uppy-Dashboard-Item-errorMessageBtn {
+  font-size: 11px;
   text-decoration: underline;
+  color: darken($red, 15%);
   cursor: pointer;
   font-weight: 500;
 }

+ 2 - 1
packages/@uppy/dashboard/src/components/FileItem/MetaErrorMessage.jsx

@@ -1,7 +1,8 @@
 import { h } from 'preact'
 
 const metaFieldIdToName = (metaFieldId, metaFields) => {
-  const field = metaFields.filter(f => f.id === metaFieldId)
+  const fields = typeof metaFields === 'function' ? metaFields() : metaFields
+  const field = fields.filter(f => f.id === metaFieldId)
   return field[0].name
 }