Skip to content
Snippets Groups Projects
Commit e2c2392a authored by Paul Kaplan's avatar Paul Kaplan
Browse files

Only show items in the library that would have image steps for offline

Because the video steps get replaced by an image step if offline, we should not show items that would result in having no content
parent 5160b5ae
Branches
Tags
No related merge requests found
......@@ -62,10 +62,16 @@ class TipsLibrary extends React.PureComponent {
}
render () {
const decksLibraryThumbnailData = Object.keys(decksLibraryContent)
.filter(id =>
.filter(id => {
if (notScratchDesktop()) return true; // Do not filter anything in online editor
const deck = decksLibraryContent[id];
// Scratch Desktop doesn't want tutorials with `requiredProjectId`
notScratchDesktop() || !decksLibraryContent[id].hasOwnProperty('requiredProjectId')
)
if (deck.hasOwnProperty('requiredProjectId')) return false;
// Scratch Desktop should not load tutorials that are _only_ videos
if (deck.steps.filter(s => s.title).length === 0) return false;
// Allow any other tutorials
return true;
})
.map(id => ({
rawURL: decksLibraryContent[id].img,
id: id,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment