Skip to content

Commit 6005c02

Browse files
committed
cleanup code
1 parent 024d9c4 commit 6005c02

1 file changed

Lines changed: 7 additions & 14 deletions

File tree

public/develop.js

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -164,11 +164,6 @@ import {
164164
versionSelectorInput.addEventListener("input", async _ => await updateOrnitheDependencies())
165165

166166
allowSnapshotsCheck.addEventListener("change", async _ => {
167-
if (allowSnapshotsCheck.checked) {
168-
possibleVersions = minecraftAllVersions;
169-
} else {
170-
possibleVersions = minecraftStableVersions;
171-
}
172167
updateVersionList();
173168
await updateOrnitheDependencies();
174169
})
@@ -178,28 +173,26 @@ import {
178173
minecraftStableVersions = await getMinecraftStableVersions(gen);
179174
minecraftAllVersions = await getMinecraftVersions(gen);
180175

181-
// Update the version list based on snapshot checkbox
182-
if (allowSnapshotsCheck.checked) {
183-
possibleVersions = minecraftAllVersions;
184-
} else {
185-
possibleVersions = minecraftStableVersions;
186-
}
187176
updateVersionList();
188177
// Update the dependencies message since it depends on the feather gen
189178
await updateOrnitheDependencies();
190179
})
191180

192181
function updateVersionList() {
193-
const list = possibleVersions;
182+
if (allowSnapshotsCheck.checked) {
183+
possibleVersions = minecraftAllVersions;
184+
} else {
185+
possibleVersions = minecraftStableVersions;
186+
}
187+
194188
while (versionListElement.firstChild) versionListElement.removeChild(versionListElement.lastChild);
195-
list.forEach(e => {
189+
possibleVersions.forEach(e => {
196190
const opt = new Option();
197191
opt.value = e;
198192
versionListElement.appendChild(opt);
199193
});
200194
}
201195

202-
possibleVersions = minecraftStableVersions;
203196
updateVersionList()
204197
await updateOrnitheDependencies()
205198

0 commit comments

Comments
 (0)