Skip to content

Commit 33bef66

Browse files
authored
Fix download page not removing modules it says it's removing (#6340)
1 parent 24ebb20 commit 33bef66

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

assets/js/download.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@
8686
$('#download-button').html('<i class="glyphicon glyphicon-send"></i> Sending Request...').addClass('disabled');
8787

8888
var form_data = get_form_data();
89+
const removedModules = form_data.removedModules;
90+
delete form_data.removedModules;
8991
$.ajax({
9092
type: "POST",
9193
url: "https://js-download.prebid.org/download",
@@ -112,12 +114,12 @@
112114
triggerDownload(jsBlob, filename);
113115
triggerDownload(new Blob([configData], { type: "application/json" }), "prebid-config.json");
114116

115-
if (form_data["removedModules"].length > 0) {
117+
if (removedModules.length > 0) {
116118
alert(
117119
"The following modules were removed from your download because they aren't present in Prebid.js version " +
118120
form_data["version"] +
119121
": " +
120-
JSON.stringify(form_data["removedModules"])
122+
JSON.stringify(removedModules)
121123
);
122124
}
123125
})
@@ -179,7 +181,7 @@
179181
});
180182

181183
return {
182-
modules: renameModules(version, modules),
184+
modules: renameModules(version, modules).filter(mod => !removedModules.includes(mod)),
183185
version,
184186
removedModules,
185187
};

0 commit comments

Comments
 (0)