mirror of
https://github.com/outline/outline.git
synced 2026-06-13 03:14:59 +03:00
fix: avoid "Imported from undefined" in document insights (#12378)
Only render the "Imported from" line when a source name or filename is actually available, since sourceMetadata can exist without either.
This commit is contained in:
@@ -58,12 +58,13 @@ function Insights({ document }: Props) {
|
||||
{t(`Last updated`)}{" "}
|
||||
<Time dateTime={document.updatedAt} addSuffix />
|
||||
</li>
|
||||
{document.sourceMetadata && (
|
||||
{(document.sourceName ||
|
||||
document.sourceMetadata?.fileName) && (
|
||||
<li>
|
||||
{t("Imported from {{ source }}", {
|
||||
source:
|
||||
document.sourceName ??
|
||||
`“${document.sourceMetadata.fileName}”`,
|
||||
`“${document.sourceMetadata?.fileName}”`,
|
||||
})}
|
||||
</li>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user