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}
{$_("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}