mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-09-30 23:01:05 -05:00
Don't load the client if teams fail to load
If teams fail to load due to some bug, the user may lose their teams permanently if they save their teams. In avoid to avoid a catastrophe, we now decline to load the client if teams fail to load. This should never happen unless a bug is introduced that breaks team loading.
This commit is contained in:
@@ -205,6 +205,7 @@ if (!$challengeresponse) {
|
||||
<script src="/js/sim.js?"></script>
|
||||
|
||||
<script>
|
||||
if (!teams) Config.down = true;
|
||||
if (Config.down) overlay('down');
|
||||
</script>
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ var curRoom = null;
|
||||
var curTitle = 'Showdown!';
|
||||
var battles = {};
|
||||
var formats = [''];
|
||||
var teams = [];
|
||||
var teams = null;
|
||||
|
||||
var isAndroid = navigator.userAgent.toLowerCase().indexOf("android") > -1 && navigator.userAgent.toLowerCase().indexOf("firefox") <= -1;
|
||||
|
||||
@@ -3170,8 +3170,9 @@ function init() {
|
||||
}
|
||||
|
||||
var cookieTeams = true;
|
||||
(function () {
|
||||
teams = (function() {
|
||||
var savedTeam = $.parseJSON($.cookie('showdown_team1'));
|
||||
var teams = [];
|
||||
if (savedTeam) {
|
||||
teams.push(savedTeam);
|
||||
}
|
||||
@@ -3188,6 +3189,7 @@ var cookieTeams = true;
|
||||
var teamString = localStorage.getItem('showdown_teams');
|
||||
if (teamString) teams = JSON.parse(teamString);
|
||||
}
|
||||
return teams;
|
||||
})();
|
||||
|
||||
// time to connect
|
||||
|
||||
Reference in New Issue
Block a user