Skip to content

Commit c2ff248

Browse files
committed
Website: Fix Download page not handling multiple dependencies when from Redownload URL
1 parent 38ce121 commit c2ff248

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

download.js

+14-8
Original file line numberDiff line numberDiff line change
@@ -41,20 +41,26 @@ if (hstr) {
4141
}
4242
setTheme(ids[0]);
4343
}
44-
ids.forEach(function(id) {
44+
var makeDefault = function (id) {
4545
if (id !== 'meta') {
4646
if (components[category][id]) {
47-
var requireId = id;
48-
while (requireId && components[category][requireId] && components[category][requireId].option !== 'default') {
49-
if (typeof components[category][requireId] === 'string') {
50-
components[category][requireId] = { title: components[category][requireId] }
47+
if (components[category][id].option !== 'default') {
48+
if (typeof components[category][id] === 'string') {
49+
components[category][id] = { title: components[category][id] }
5150
}
52-
components[category][requireId].option = 'default';
53-
requireId = components[category][requireId].require;
51+
components[category][id].option = 'default';
52+
}
53+
if (components[category][id].require) {
54+
var deps = components[category][id].require;
55+
if ($u.type(deps) !== 'array') {
56+
deps = [deps];
57+
}
58+
deps.forEach(makeDefault);
5459
}
5560
}
5661
}
57-
});
62+
};
63+
ids.forEach(makeDefault);
5864
}
5965
});
6066
}

0 commit comments

Comments
 (0)