fix: allow users to submit after editing (#46939)

If a user runs the tests and they pass, the multifile editor will show a
submit button.  If the user then edited the page, it would no longer be
possible to submit.

This ensures the redux store keeps the original, passing, tests and lets
the user submit
pull/46942/head
Oliver Eyton-Williams 2022-07-18 14:57:53 +02:00 committed by GitHub
parent 9421aa6041
commit 0e8113b4af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -1084,7 +1084,10 @@ const Editor = (props: EditorProps): JSX.Element => {
focusIfTargetEditor();
}
if (props.initialTests) initTests(props.initialTests);
// Once a challenge has been completed, we don't want changes to the content
// to reset the tests since the user is already done with the challenge.
if (props.initialTests && !challengeIsComplete())
initTests(props.initialTests);
if (hasEditableRegion() && editor) {
if (props.isResetting) {