Skip to content

Commit

Permalink
add timeout to resetballot cause recursion
Browse files Browse the repository at this point in the history
  • Loading branch information
benadida committed May 23, 2019
1 parent bed67e6 commit 3d208ee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/AppEndToEnd.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ it(`basic end-to-end flow`, async () => {
})

// Review and Cast Instructions
await sleep(100)
getByText('Verify and Cast Your Ballot')

// ===========================================================================
Expand Down
4 changes: 3 additions & 1 deletion src/pages/PrintPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,9 @@ class SummaryPage extends React.Component<RouteComponentProps, State> {
window.removeEventListener('afterprint', this.resetBallot)
}
public resetBallot = () => {
this.context.resetBallot('/cast')
window.setTimeout(() => {
this.context.resetBallot('/cast')
}, 0)
}
public hideConfirm = () => {
this.setState({ showConfirmModal: false })
Expand Down

0 comments on commit 3d208ee

Please sign in to comment.