diff --git a/play.pokemonshowdown.com/js/client-teambuilder.js b/play.pokemonshowdown.com/js/client-teambuilder.js index 22189c6e2d..597f103b2e 100644 --- a/play.pokemonshowdown.com/js/client-teambuilder.js +++ b/play.pokemonshowdown.com/js/client-teambuilder.js @@ -181,12 +181,14 @@ tryLoadFormatResource: function (format) { var teambuilder = this; - if (teambuilder.formatResources[format]) { // already loading, bypass + if (format in teambuilder.formatResources) { // already loading, bypass return; } + console.log(`called for ${format}`); teambuilder.formatResources[format] = true; // true - loading, array - loaded $.get('https://www.smogon.com/dex/api/formats/by-ps-name/' + format, {}, function (data) { - teambuilder.formatResources[format] = data; + // if the data doesn't exist, set it to true so it stops trying to load it + teambuilder.formatResources[format] = data || true; teambuilder.update(); }); },