only load set data if needed

This commit is contained in:
marsteralex 2022-08-15 20:42:05 -04:00
parent c6ea364218
commit cc15e46874

View File

@ -20,10 +20,6 @@ flag = true
page = 1
sets = {}
fetch('jsons/set.json')
.then((response) => response.json())
.then((data) => (sets = data))
window.console.log(sets)
document.location.search.split('&').forEach((pair) => {
let v = pair.split('=')
@ -38,6 +34,12 @@ document.location.search.split('&').forEach((pair) => {
}
})
if (whichGuesser === 'basic') {
fetch('jsons/set.json')
.then((response) => response.json())
.then((data) => (sets = data))
}
let firstFetch = fetch('jsons/' + whichGuesser + '.json')
fetchToResponse(firstFetch)