fix bug where url draft attempt crashes
When a user saves a draft URL on the third attempt and then attempts to navigate to the first attempt the page would crash. Test Plan: - Create a course and add a student to it - Create an assignment with an online url submission type - As the student navigate to the assignment and create and submit 2 drafts - Create a third draft and then attempt to navigate to the first draft - Note that the page no longer crashes fixes KNO-145 flag=assignments_2_student Change-Id: I1c75d4e08d43f0f282c4fec5329b08f97d09ce4e Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/217913 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Tested-by: Jenkins Product-Review: Matthew Lemon <mlemon@instructure.com> Reviewed-by: Steven Burnett <sburnett@instructure.com> Reviewed-by: Ryan Shaw <ryan@instructure.com> QA-Review: Steven Burnett <sburnett@instructure.com>
This commit is contained in:
parent
ba7f83d080
commit
e320e69e65
|
@ -46,7 +46,8 @@ class UrlEntry extends React.Component {
|
|||
|
||||
componentDidUpdate(prevProps) {
|
||||
if (
|
||||
this.props.submission?.submissionDraft?.url !== prevProps.submission?.submissionDraft?.url
|
||||
this.props.submission?.submissionDraft?.url &&
|
||||
this.props.submission.submissionDraft.url !== prevProps.submission?.submissionDraft?.url
|
||||
) {
|
||||
this.updateInputState()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue