Verified Commit 57e29123 authored by Hugo Kerstens's avatar Hugo Kerstens
Browse files

Fix specify page button for 0 and 1 problems

parent 7c83acc3
......@@ -55,11 +55,11 @@ const ExamContent = (props) => {
</div>
</div>
))}
<button
{problemCount ? <button
className='button problem is-link is-fullwidth'
onClick={props.addPage}>
<span>{addPageButtonText}</span>
</button>
</button> : null}
</div>
)
}
......@@ -124,7 +124,7 @@ class PanelEditUnstructured extends React.Component {
}
addPage = () => {
const lastPage = this.state.problems.length > 1 ? this.state.problems[this.state.problems.length - 1].page : -1
const lastPage = this.state.problems.length > 0 ? this.state.problems[this.state.problems.length - 1].page : -1
this.createProblem(lastPage + 1)
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment