Skip to content

Commit 495c66d

Browse files
committed
Use default format from localStorage if valid
1 parent dd3dc08 commit 495c66d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Diff for: play.pokemonshowdown.com/js/client-mainmenu.js

+6
Original file line numberDiff line numberDiff line change
@@ -1026,6 +1026,11 @@
10261026
return '<button class="select formatselect" name="format" disabled><em>No formats available</em></button>';
10271027
}
10281028
if (!noChoice) {
1029+
var defaultFormat = Storage.prefs('defaultformat');
1030+
if(BattleFormats[defaultFormat]) {
1031+
this.curFormat = defaultFormat;
1032+
}
1033+
else {
10291034
this.curFormat = formatid;
10301035
if (!this.curFormat) {
10311036
if (BattleFormats['gen9randombattle']) {
@@ -1036,6 +1041,7 @@
10361041
break;
10371042
}
10381043
}
1044+
}
10391045
formatid = this.curFormat;
10401046
}
10411047
return '<button class="select formatselect' + (noChoice ? ' preselected' : '') + '" name="format" value="' + formatid + '"' + (noChoice ? ' disabled' : '') + '>' + BattleLog.escapeFormat(formatid) + '</button>';

0 commit comments

Comments
 (0)