0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-24 14:12:40 +00:00

tweak validation rules on Thumbnail & prevent invalid field from block valid fields

This commit is contained in:
Gazook89
2022-11-13 12:45:31 -06:00
parent 96da053717
commit 4f762b376f
2 changed files with 2 additions and 1 deletions

View File

@@ -65,7 +65,7 @@ const MetadataEditor = createClass({
[name] : validationErr.length > 0 ? validationErr : undefined
}
}), ()=>{
if(Object.values(this.state.errs ?? {}).filter(Boolean).length === 0 || !this.state.errs[name]){
if(validationErr.length === 0){
e.target.setCustomValidity('');
this.props.onChange({
...this.props.metadata,

View File

@@ -14,6 +14,7 @@ module.exports = {
return value?.length > 256 ? 'Max URL length of 256 characters.' : null;
},
(value)=>{
if(value?.length == 0){return null;}
try {
Boolean(new URL(value));
return null;