fix(client): update store after any submission (#41329)

This commit is contained in:
Shaun Hamilton
2021-03-04 21:01:18 +00:00
committed by GitHub
parent cd40d47363
commit 36f58bcfdf
5 changed files with 21 additions and 9 deletions

View File

@@ -31,9 +31,9 @@ export class SolutionForm extends Component {
handleSubmit(validatedValues) {
// Do not execute challenge, if errors
if (validatedValues.errors.length === 0) {
// updates values on store
this.props.updateSolutionForm(validatedValues.values);
if (validatedValues.invalidValues.length === 0) {
// updates values on server
this.props.updateSolutionForm(validatedValues.values);
this.props.onSubmit({ isShouldCompletionModalOpen: true });
} else {
this.props.onSubmit({ isShouldCompletionModalOpen: false });
@@ -59,7 +59,8 @@ export class SolutionForm extends Component {
githubLink: 'url'
},
required: ['solution'],
isEditorLinkAllowed: false
isEditorLinkAllowed: false,
isLocalLinkAllowed: false
};
const buttonCopy = isSubmitting
@@ -79,6 +80,7 @@ export class SolutionForm extends Component {
case backend:
formFields = solutionField;
options.isLocalLinkAllowed = true;
solutionLink = solutionLink + 'https://project-name.camperbot.repl.co/';
break;