mirror of
https://github.com/strapi/strapi.git
synced 2025-09-25 16:29:34 +00:00
Fix UX on inputchange for database name
This commit is contained in:
parent
09f1563275
commit
66a1f3a6ba
@ -28,7 +28,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { isEmpty, includes, mapKeys, reject, map, isObject, union, findIndex, uniqBy } from 'lodash';
|
import { isEmpty, includes, mapKeys, reject, map, isObject, union, findIndex, uniqBy, remove } from 'lodash';
|
||||||
import { FormattedMessage } from 'react-intl';
|
import { FormattedMessage } from 'react-intl';
|
||||||
import WithInput from 'components/WithInput';
|
import WithInput from 'components/WithInput';
|
||||||
|
|
||||||
@ -50,6 +50,8 @@ class InputText extends React.Component { // eslint-disable-line react/prefer-st
|
|||||||
componentWillReceiveProps(nextProps) {
|
componentWillReceiveProps(nextProps) {
|
||||||
if (this.props.errors !== nextProps.errors) {
|
if (this.props.errors !== nextProps.errors) {
|
||||||
const errors = uniqBy(union(this.state.errors, nextProps.errors), 'id');
|
const errors = uniqBy(union(this.state.errors, nextProps.errors), 'id');
|
||||||
|
|
||||||
|
if (isEmpty(nextProps.errors)) remove(errors, (error) => error.id === 'settings-manager.request.error.database.exist');
|
||||||
this.setState({ errors });
|
this.setState({ errors });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user