     optionsHash = ProfilePageHash.parse location.hash
     @initialPage = optionsHash.page
 
-    currentMode: @validMode(optionsHash.mode ? @props.user.playmode)
-    user: @props.user
-    userPage:
-      html: @props.userPage.html
-      initialRaw: @props.userPage.raw
-      raw: @props.userPage.raw
-      editing: false
-      selection: [0, 0]
-    tabsSticky: false
-    profileOrder: @props.user.profileOrder[..]
-
-
-  componentDidMount: ->
+    @state =
+      currentMode: @validMode(optionsHash.mode ? props.user.playmode)
+      user: props.user
+      userPage:
+        html: props.userPage.html
+        initialRaw: props.userPage.raw
+        raw: props.userPage.raw
+        editing: false
+        selection: [0, 0]
+      tabsSticky: false
+      profileOrder: props.user.profileOrder[..]
+
+
+  componentDidMount: =>
     $.subscribe 'user:update.profilePage', @userUpdate
     $.subscribe 'user:page:update.profilePage', @userPageUpdate
     $.subscribe 'playmode:set.profilePage', @setCurrentMode
     $.subscribe 'profile:page:jump.profilePage', @pageJump
     $.subscribe 'stickyHeader.profilePage', @_tabsStick
+    $(window).on 'throttled-scroll.profilePage', @pageScan
 
     $(@refs.pages).sortable
       cursor: 'move'

      el component, props


  setCurrentMode: (_e, {mode}) ->
    return if @state.currentMode == mode
    @setState currentMode: @validMode(mode)


  updateOrder: (event) ->
    $elems = $(event.target)

    newOrder = $elems.sortable('toArray', attribute: 'data-page-id')

      .always LoadingOverlay.hide


  userUpdate: (_e, user) =>
    return if !user?
    @setState user: user


  userPageUpdate: (_e, newUserPage) =>
    currentUserPage = _.cloneDeep @state.userPage
    @setState userPage: _.extend(currentUserPage, newUserPage)


  validMode: (mode) =>
    modes = BeatmapHelper.modes

    if _.includes(modes, mode)
