Skip to content

Commit 2d22a1b

Browse files
committed
Show unsorted demos
1 parent 357a700 commit 2d22a1b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

routes/samples/list-samples.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ const getSamples = () => {
110110
)
111111
);
112112

113+
const uncategorized = [];
114+
113115
// Get the unique list of categories from the demos
114116
const categories = demoConfigGroup?.categories || [];
115117

@@ -150,6 +152,11 @@ const getSamples = () => {
150152
if (categories.includes(category)) {
151153
demo.priority = priority || 1000;
152154
demosInCategory.push(demo);
155+
} else if (categories.length === 0) {
156+
// No category set, add to uncategorized
157+
if (!uncategorized.includes(demo)) {
158+
uncategorized.push(demo);
159+
}
153160
}
154161
}
155162

@@ -158,10 +165,11 @@ const getSamples = () => {
158165
samples.push.apply(samples, demosInCategory);
159166

160167
});
168+
samples.push.apply(samples, uncategorized);
161169
}
162-
163170
samples.push.apply(samples, otherSamples);
164171
}
172+
165173
});
166174
return JSON.stringify(samples, null, ' ');
167175
};

0 commit comments

Comments
 (0)