• Robert Knight's avatar
    Improve handling of annotation fetch error in single annotation view · 23a13091
    Robert Knight authored
    Previously if the user visited a `/a/<ID>` URL and the request to fetch
    the annotation failed with a 404 then the user would see a blank page.
    If the fetch failed because the annotation was private, logging in did
    not cause the annotation to be fetched.
    
    This commit resolves the two issues:
    
     - When the logged-in user changes, re-fetch the annotation
     - If the annotation fetch fails, an "Annotation unavailable" message is
       shown. This currently repurposes the error that is shown when a
       direct-linked annotation fetch fails, but without the "Clear
       selection" button.
    
    This commit also fixes an issue where a direct link to a group that
    could not be fetched would show a "Clear selection" button even though
    there was no active selection to clear. That button is only needed when
    following a direct link to an annotation.
    23a13091
sidebar-content.js 5.43 KB