Skip to content

Commit

Permalink
prevent user from getting stuck in enterSyncCode modal if back-end fails
Browse files Browse the repository at this point in the history
  • Loading branch information
cezaraugusto committed Jan 2, 2019
1 parent 0f8efe3 commit d678ef6
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions components/brave_sync/ui/components/modals/enterSyncCode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,19 @@ export default class EnterSyncCodeModal extends React.PureComponent<Props, State
) {
this.setState({ willCreateNewSyncChainFromCode: false })
this.props.onClose()
return
}

// eventually re-enable this dialog if it takes too long to process.
// this is useful when the back-end isn't responsive and avoids letting
// the user stuck in a blocked interface. this does not enable sync via code words
if (
this.state.willCreateNewSyncChainFromCode &&
this.props.syncData.isSyncConfigured === false
) {
window.setTimeout(() =>
this.setState({ willCreateNewSyncChainFromCode: false }
), 30000)
}
}

Expand Down

0 comments on commit d678ef6

Please sign in to comment.