         # This is used by the base class for marking file use notifications.
         @_redux = require('./smc-react').redux
 
+        # 60 min default. Correct val will get set when user account settings are loaded.
+        # Set here rather than in @_init_idle to avoid any potential race.
+        @_idle_timeout = 60 * 60 * 1000
+
         setTimeout(@_init_idle, 15 * 1000)
 
         # Start reporting metrics to the backend if requested.

        if not @_idle_time?
            return
        now = (new Date()).getTime()
        # console.log("idle: checking idle #{@_idle_time} < #{now}")
        if @_idle_time < now
            @emit('idle', 'away')

    # Set @_idle_time to the **moment in in the future** at which the user will be
    # considered idle, and also emit event indicator using is currently active.
    _idle_reset: =>
        @_idle_time = (new Date()).getTime() + @_idle_timeout + 1000
        # console.log '_idle_reset', new Date(@_idle_time), ' _idle_timeout=', @_idle_timeout
        @emit('idle', 'active')

    # Change the standby timeout to a particular time in minutes.
    # This gets called when the user configuration settings are set/loaded.
    set_standby_timeout_m: (time_m) =>
        @_idle_timeout = time_m * 60 * 1000
        @_idle_reset()


        A document.body event listener here and one for each jupyter iframe.body (see jupyter.coffee).
        ###

        @_idle_reset()
        setInterval(@_idle_check, 60 * 1000)

