mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-03-21 17:50:29 -05:00
Preact: Fix team requirement logic for custom named tournaments (#2579)
This commit is contained in:
parent
7df45ea835
commit
ebe6dee892
|
|
@ -830,10 +830,12 @@ export class TeamForm extends preact.Component<{
|
|||
submit = (ev: Event, validate?: 'validate') => {
|
||||
ev.preventDefault();
|
||||
let format = this.format;
|
||||
// in tournaments, format is the custom name & teamFormat is the original format.
|
||||
const teambuilderFormat = this.props.teamFormat || PS.teams.teambuilderFormat(format);
|
||||
const teamElement = this.base!.querySelector<HTMLButtonElement>('button[name=team]');
|
||||
const teamKey = teamElement!.value;
|
||||
const team = teamKey ? PS.teams.byKey[teamKey] : undefined;
|
||||
if (!window.BattleFormats[PS.teams.teambuilderFormat(format)]?.team && !team) {
|
||||
if (!window.BattleFormats[teambuilderFormat]?.team && !team) {
|
||||
PS.alert('You need to go into the Teambuilder and build a team for this format.', {
|
||||
parentElem: teamElement!,
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user