Skip to content

Commit

Permalink
Refactor team name update logic in CreateTeam component
Browse files Browse the repository at this point in the history
  • Loading branch information
renatodellosso committed Jan 29, 2025
1 parent 48c36bb commit aef2963
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pages/createTeam.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export default function CreateTeam() {
.getTeamAutofillData(team.number!, team.league ?? League.FRC)
.catch(() => null)
.then((data) => {
if (data) setTeam({ ...team, name: data.name });
if (data) setTeam((team) => ({ ...team, name: data.name }));
setError("");
});
}, [team.number, team.league]);
Expand Down

0 comments on commit aef2963

Please sign in to comment.