Skip to content

Commit 64d5fe2

Browse files
committed
Store most recent format as defaultformat
1 parent 495c66d commit 64d5fe2

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

play.pokemonshowdown.com/js/client-mainmenu.js

+10-9
Original file line numberDiff line numberDiff line change
@@ -1031,17 +1031,17 @@
10311031
this.curFormat = defaultFormat;
10321032
}
10331033
else {
1034-
this.curFormat = formatid;
1035-
if (!this.curFormat) {
1036-
if (BattleFormats['gen9randombattle']) {
1037-
this.curFormat = 'gen9randombattle';
1038-
} else for (var i in BattleFormats) {
1039-
if (!BattleFormats[i].searchShow || !BattleFormats[i].challengeShow) continue;
1040-
this.curFormat = i;
1041-
break;
1034+
this.curFormat = formatid;
1035+
if (!this.curFormat) {
1036+
if (BattleFormats['gen9randombattle']) {
1037+
this.curFormat = 'gen9randombattle';
1038+
} else for (var i in BattleFormats) {
1039+
if (!BattleFormats[i].searchShow || !BattleFormats[i].challengeShow) continue;
1040+
this.curFormat = i;
1041+
break;
1042+
}
10421043
}
10431044
}
1044-
}
10451045
formatid = this.curFormat;
10461046
}
10471047
return '<button class="select formatselect' + (noChoice ? ' preselected' : '') + '" name="format" value="' + formatid + '"' + (noChoice ? ' disabled' : '') + '>' + BattleLog.escapeFormat(formatid) + '</button>';
@@ -1438,6 +1438,7 @@
14381438
});
14391439
}
14401440
this.sourceEl.val(format).html(BattleLog.escapeFormat(format) || '(Select a format)');
1441+
Storage.prefs('defaultformat', format);
14411442

14421443
this.close();
14431444
}

0 commit comments

Comments
 (0)