Skip to content

Commit b1aec65

Browse files
authored
Merge pull request #26 from JosephHerson/patch-1
911202: Need to resolve the issue occurs when run the JS public samples
2 parents 1929ad1 + 1a0cde6 commit b1aec65

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

gulpfile.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -285,9 +285,10 @@ function combineSampleList(platform, seo, done) {
285285
for (var i = 0; i < orderKeys.length; i++) {
286286
console.log('Category : ' + orderKeys[i]);
287287
var components = sampleOrder[orderKeys[i]];
288+
let category = orderKeys[i];
288289
for (var j = 0; j < components.length; j++) {
289290
console.log('Component : ' + components[j]);
290-
var currentData = getSamples(data, components[j]);
291+
var currentData = getSamples(data, components[j], category);
291292
currentData.order = i;
292293
result.push(currentData);
293294
}
@@ -349,11 +350,11 @@ function getSampleOrder(controls) {
349350
return controlWiseSampleOrder;
350351
}
351352

352-
function getSamples(data, component) {
353+
function getSamples(data, component, category) {
353354
var dataList = Object.keys(data);
354355
for (var i = 0; i < dataList.length; i++) {
355356
var currentData = data[dataList[i]];
356-
if (component === currentData.name) {
357+
if (component === currentData.name && category === currentData.category) {
357358
return currentData;
358359
}
359360
}
@@ -464,4 +465,4 @@ gulp.task('serve', function(done) {
464465
};
465466
bs.init(options, done);
466467
});
467-
});
468+
});

0 commit comments

Comments
 (0)