Skip to content

Commit 1949f89

Browse files
updated the condition
1 parent 6e2c18f commit 1949f89

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

gulpfile.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ function generateSearchIndex(sampleArray) {
4040
fs.writeFileSync('./src/common/search-index.json', JSON.stringify(instance.toJSON()));
4141
}
4242

43-
function getSamples(data, component) {
43+
function getSamples(data, component, category) {
4444
var dataList = Object.keys(data);
4545
for (var i = 0; i < dataList.length; i++) {
4646
var currentData = data[dataList[i]];
47-
if (component === currentData.name) {
47+
if (component === currentData.name && category === currentData.category) {
4848
return currentData;
4949
}
5050
}
@@ -138,8 +138,9 @@ gulp.task('combine-samplelist', function() {
138138
var orderKeys = Object.keys(sampleOrder);
139139
for (var i = 0; i < orderKeys.length; i++) {
140140
var components = sampleOrder[orderKeys[i]];
141+
let category = orderKeys[i];
141142
for (var j = 0; j < components.length; j++) {
142-
var currentData = getSamples(data, components[j]);
143+
var currentData = getSamples(data, components[j], category);
143144
currentData['order'] = i;
144145
result.push(currentData);
145146
}

0 commit comments

Comments
 (0)