 
   defaultParams:
     animateIntro: no
-
   view:
     currentAction: "#current_action"
+  timer: null
 
   onAfterRender: ->
     super
-    do @_listenEvents
+    @_listenEvents()
     @view.spinner = ledger.spinners.createLargeSpinner(@select('div.greyed-container')[0])
     @view.currentAction.text(t 'onboarding.device.connecting.is_connecting')
+    @_launchAttestation()
 
   openSupport: ->
     window.open t 'application.support_url'

          else
            ledger.app.router.go '/onboarding/management/welcome'

  navigateError: ->
    ledger.app.wallet?.isDongleBetaCertified (__, error) =>
      if error?
        ledger.app.router.go '/onboarding/device/forged'

            ledger.app.setExecutionMode(ledger.app.Modes.FirmwareUpdate)
            ledger.app.router.go '/update/index', {hidePreviousButton: yes}
          else
            @_navigateContinue()

  _navigateError: ->
    @_stopTimer()
    ledger.app.router.go '/onboarding/device/failed'

  _listenEvents: ->
    ledger.app.once 'dongle:connected', => @_navigateContinue()
    ledger.app.once 'dongle:forged', => @_navigateForged()
    ledger.app.once 'dongle:communication_error', => @_navigateError()

  _stopTimer: ->
    if @timer?
      clearTimeout @timer
      @timer = null

  _launchAttestation: ->
    if ledger.app.wallet?
      ledger.app.performDongleAttestation()
    @timer = setTimeout =>
      # attestation timed out
      @_navigateError()
    , 30000