Skip to content

Commit

Permalink
setCustomValidity translates api key errors, removed unncessary error…
Browse files Browse the repository at this point in the history
… check
  • Loading branch information
ZenMasterJacob20011 committed May 23, 2024
1 parent 897529c commit 77144cc
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/WebformBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -1285,14 +1285,10 @@ export default class WebformBuilder extends Component {

this.webform.everyComponent((comp) => {
const path = comp.path;
const errors = comp.visibleErrors || [];
if (repeatablePaths.includes(path)) {
comp.setCustomValidity(`API Key is not unique: ${comp.key}`);
comp.setCustomValidity(this.t('apiKey', { key: comp.key }));
hasInvalidComponents = true;
}
else if (errors.length && errors[0].message?.startsWith('API Key is not unique')) {
comp.setCustomValidity('');
}
});

this.emit('builderFormValidityChange', hasInvalidComponents);
Expand Down

0 comments on commit 77144cc

Please sign in to comment.