@epic-web/workshop-utils 6.51.0 → 6.52.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/apps.server.js +11 -3
- package/package.json +1 -1
package/dist/apps.server.js
CHANGED
|
@@ -416,7 +416,12 @@ async function _getApps({ timings, request, } = {}) {
|
|
|
416
416
|
}
|
|
417
417
|
}
|
|
418
418
|
// at this point, we know that a and b are different types...
|
|
419
|
-
|
|
419
|
+
// Both should be problem or solution apps at this point
|
|
420
|
+
const aIsProblem = isProblemApp(a);
|
|
421
|
+
const aIsSolution = isSolutionApp(a);
|
|
422
|
+
const bIsProblem = isProblemApp(b);
|
|
423
|
+
const bIsSolution = isSolutionApp(b);
|
|
424
|
+
if (aIsProblem && bIsSolution) {
|
|
420
425
|
if (a.exerciseNumber === b.exerciseNumber) {
|
|
421
426
|
return a.stepNumber <= b.stepNumber ? 1 : -1;
|
|
422
427
|
}
|
|
@@ -424,7 +429,7 @@ async function _getApps({ timings, request, } = {}) {
|
|
|
424
429
|
return a.exerciseNumber <= b.exerciseNumber ? 1 : -1;
|
|
425
430
|
}
|
|
426
431
|
}
|
|
427
|
-
if (
|
|
432
|
+
if (aIsSolution && bIsProblem) {
|
|
428
433
|
if (a.exerciseNumber === b.exerciseNumber) {
|
|
429
434
|
return a.stepNumber < b.stepNumber ? -1 : 1;
|
|
430
435
|
}
|
|
@@ -432,7 +437,10 @@ async function _getApps({ timings, request, } = {}) {
|
|
|
432
437
|
return a.exerciseNumber < b.exerciseNumber ? -1 : 1;
|
|
433
438
|
}
|
|
434
439
|
}
|
|
435
|
-
console.error('unhandled sorting case',
|
|
440
|
+
console.error('unhandled sorting case', {
|
|
441
|
+
a: { type: a.type, name: a.name, isProblem: aIsProblem, isSolution: aIsSolution },
|
|
442
|
+
b: { type: b.type, name: b.name, isProblem: bIsProblem, isSolution: bIsSolution },
|
|
443
|
+
});
|
|
436
444
|
return 0;
|
|
437
445
|
});
|
|
438
446
|
return sortedApps;
|