Skip to content
This repository was archived by the owner on Sep 22, 2023. It is now read-only.

Commit 2c32b8f

Browse files
committed
Prevent double linking to collections
Parented collection snippets will link to their recomended collection via the breadcrumb, instead of the recommendations section.
1 parent 21c951f commit 2c32b8f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/blocks/models/snippet.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,9 @@ export const snippet = {
229229
hasCollection: snippet =>
230230
Boolean(snippet.collections && snippet.collections.length),
231231
recommendedCollection: snippet =>
232-
snippet.hasCollection ? snippet.collections.first : null,
232+
snippet.hasCollection && !snippet.collections.first.listing.parent
233+
? snippet.collections.first
234+
: null,
233235
},
234236
lazyProperties: {
235237
icon: ({ models: { Language } }) => snippet => {

0 commit comments

Comments
 (0)