Skip to content

Commit

Permalink
fix(core): simplify code for getting preview paths
Browse files Browse the repository at this point in the history
  • Loading branch information
ninaandal committed Dec 13, 2023
1 parent 2083fd3 commit c89b026
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export function getReferenceInfo(
} as const)
}

const previewPaths = [...(getPreviewPaths(refSchemaType?.preview) || [])]
const previewPaths = getPreviewPaths(refSchemaType?.preview) || []

const draftPreview$ = documentPreviewStore.observePaths(draftRef, previewPaths).pipe(
map((result) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export function createGetReferenceInfo(context: {
(candidate) => candidate.type === resolvedDoc._type,
)

const previewPaths = [...(getPreviewPaths(refSchemaType?.preview) || [])]
const previewPaths = getPreviewPaths(refSchemaType?.preview) || []

const publishedPreview$ = documentPreviewStore
.observePaths(doc as Previewable, previewPaths, apiConfig)
Expand Down

0 comments on commit c89b026

Please sign in to comment.