Merge branch 'master' into feat/eleventy

This commit is contained in:
Sam Carlton 2021-03-13 13:53:36 -06:00
commit a17cdb8504
6 changed files with 158 additions and 57 deletions

View file

@ -187,7 +187,7 @@ export default class AppFilesScanner {
// console.log('entries', entries)
if ( !Array.isArray(entries) ) {
file.statusMessage = '❔ Could not decompress file'
file.statusMessage = '❔ Could not decompress file. Try extracting the app or using a different app file. '
file.status = 'finished'
throw new Error('Could not decompress file')

View file

@ -270,6 +270,7 @@ export default async function () {
}
const category = {
label: categoryTitle,
slug: categorySlug
}

View file

@ -1,4 +1,13 @@
// Universal JS imports only
import slugify from 'slugify'
export function makeCategorySlug ( categoryName ) {
return slugify(categoryName, {
lower: true,
strict: true
})
}
// Contains all types of properies to keep data consistent
@ -139,5 +148,21 @@ export function getAppCategory (app) {
if (typeof app.category === 'undefined') {
console.log('app', app)
}
// If this category is not defined yet
// then add it
if ( !categories.hasOwnProperty( app.category.slug ) ) {
// console.log('app', app)
const customCategory = {
id: null,
...app.category,
}
categories[app.category.slug] = customCategory
console.log('Added new category', app.category.slug)
}
return categories[app.category.slug]
}