diff --git a/src/pages/viewer/Sidebar.svelte b/src/pages/viewer/Sidebar.svelte index 084287bf6..bd9757e2a 100644 --- a/src/pages/viewer/Sidebar.svelte +++ b/src/pages/viewer/Sidebar.svelte @@ -62,7 +62,7 @@ action: () => showEmbedFlow(document), header: $_("sidebar.share"), description: $_("sidebar.shareDesc"), - disabled: document.readable, + disabled: document?.readable, }, { id: "annotate", @@ -75,28 +75,28 @@ action: enterRedactMode, header: $_("sidebar.redact"), description: $_("sidebar.redactDesc"), - disabled: document.readable, + disabled: document?.readable, }, { id: "modify", action: enterModifyMode, header: $_("sidebar.modify"), description: $_("sidebar.modifyDesc"), - disabled: document.readable, + disabled: document?.readable, }, { id: "info", action: enterInfoMode, header: $_("sidebar.info"), description: $_("sidebar.infoDesc"), - disabled: document.readable, + disabled: document?.readable, }, { id: "data", action: enterDataMode, header: $_("sidebar.data"), description: $_("sidebar.dataDesc"), - disabled: document.readable, + disabled: document?.readable, }, { id: "sections", @@ -213,22 +213,22 @@ > {#if loaded}
- {#if !embed && document.readable} + {#if !embed && document?.readable}
{$_("sidebar.updating")}
{/if} - {#if document.description != null && document.description.trim().length > 0} + {#if document?.description != null && document?.description.trim().length > 0}
-

{document.title}

+

{document?.title}

- +
{:else} -

{document.title}

+

{document?.title}

{/if} @@ -240,19 +240,19 @@ target="_blank" rel="noopener noreferrer" class="plausible-event-name=viewer-original-document" - href={document.pdf} + href={document?.pdf} > {$_("sidebar.original")}
{/if} - {#if document.relatedArticleUrl != null && document.relatedArticleUrl.trim().length > 0} + {#if document?.relatedArticleUrl != null && document?.relatedArticleUrl.trim().length > 0}
{$_("sidebar.related")} @@ -262,21 +262,21 @@

{$_("sidebar.contributed", { values: { - name: showOrg ? document.orgString : document.userOrgString, + name: showOrg ? document?.orgString : document?.userOrgString, }, })}

- {#if document.source !== null && document.source.trim().length > 0} + {#if document?.source !== null && document?.source.trim().length > 0}

{$_("sidebar.source", { - values: { source: document.source }, + values: { source: document?.source }, })}

{/if} - {#if document.editAccess} + {#if document?.editAccess}
@@ -288,7 +288,7 @@ {#if signedIn}
{$_("sidebar.actions")}
- {#if document.editAccess} + {#if document?.editAccess} {#each actions as { id, action, header, description, disabled }}