diff --git a/app/components/DocumentBreadcrumb.js b/app/components/DocumentBreadcrumb.js index d5d4636236..eaf7a70d74 100644 --- a/app/components/DocumentBreadcrumb.js +++ b/app/components/DocumentBreadcrumb.js @@ -58,9 +58,19 @@ function useCategory(document) { const DocumentBreadcrumb = ({ document, children, onlyText }: Props) => { const { collections } = useStores(); + const { t } = useTranslation(); const category = useCategory(document); - let collection = collections.get(document.computedCollectionId); + let collection = collections.get(document.collectionId || ""); + + if (!collection && document.collectionId) { + collection = { + id: document.collectionId, + name: t("Deleted Collection"), + color: "currentColor", + url: "deleted-collection", + }; + } const path = React.useMemo( () => diff --git a/app/components/DocumentListItem.js b/app/components/DocumentListItem.js index 4fff906daa..a0de28b825 100644 --- a/app/components/DocumentListItem.js +++ b/app/components/DocumentListItem.js @@ -65,7 +65,9 @@ function DocumentListItem(props: Props, ref) { !!document.title.toLowerCase().includes(highlight.toLowerCase()); const canStar = policies.abilities(document.id).star; const can = policies.abilities(currentTeam.id); - const canCollection = document.collectionId ? policies.abilities(document.collectionId) : {}; + const collectionPolicy = document.collectionId + ? policies.abilities(document.collectionId) + : {}; return (