• Robert Knight's avatar
    Make re-fetching of annotations when the logged-in user ID changes work with OAuth · 6775fda1
    Robert Knight authored
    Refetching of annotations when the logged-in user ID changes was
    previously triggered by a complete reload of the `<sidebar-content>`
    component via a `$route.reload()` call. This happened in response to a
    `USER_CHANGED` event except for the first time that the profile was
    fetched.
    
    When using OAuth this broke because the test for whether this was the
    first profile fetch or not was based on a change from null => non null
    CSRF token (see `isInitialLoad` initialization). When using OAuth
    however, there is no CSRF token.
    
    This commit reworks refetching of annotations to remove the route
    reloading and instead trigger it in the same way that it is triggered
    when frames connect or disconnect, by calling
    `SidebarContentController#loadAnnotations` when the logged-in userid
    changes.
    6775fda1
hypothesis-app.js 5.96 KB