       </a>
     """
 
-  checkRenewal = ->
-    tryRenewal() if almostExpired()
-
   FacebookRenewal.success = ->
     clearTimeout timeout
     timeout      = null

    not justRenewed and timeToExpiry < 14*days

  tryRenewal = ->
    return if timeout
    FactlinkApp.facebookRenewalRegion.show new IframeView
    timeout = setTimeout tryManualRenewal, 10000

  tryManualRenewal = ->
    justRenewed = true
    FactlinkApp.NotificationCenter.error """
      Your Facebook connection could not be automatically verified. Please verify manually.

  class IframeView extends Backbone.Marionette.ItemView
    template:
      text: """
        <iframe class="facebook_renewal_iframe" src="/auth/facebook"></iframe>
      """

  FacebookRenewal.addInitializer ->
    if currentUser?.get('services')['facebook']
      tryRenewal()
      currentUser.on 'change', tryRenewal

  timeout     = null
  justRenewed = false
