Skip to content

Commit

Permalink
Shashi/fix develop branch (#517)
Browse files Browse the repository at this point in the history
Co-authored-by: Chris Nowicki <102450568+chris-nowicki@users.noreply.github.com>
  • Loading branch information
shashilo and chris-nowicki authored Sep 10, 2024
1 parent 0fd4b4d commit 6ce440d
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 6 deletions.
5 changes: 3 additions & 2 deletions app/(main)/league/[leagueId]/entry/[entryId]/week/Week.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ const Week = ({ entry, league, NFLTeams, week }: IWeekProps): JSX.Element => {
});

if (userWeeklyPickResults?.[user.id]?.[entry]) {
const userPick = userWeeklyPickResults[user.id][entry].teamName;
setUserPick(userPick.teamName);
const userPick = userWeeklyPickResults[user.id][entry];
setUserPick(userPick.teamName as unknown as string);
}
} catch (error) {
console.error('Error getting weekly pick:', error);
Expand Down Expand Up @@ -182,6 +182,7 @@ const Week = ({ entry, league, NFLTeams, week }: IWeekProps): JSX.Element => {

try {
await onWeeklyPickChange(params);
setUserPick(teamSelect);
} catch (error) {
console.error('Submission error:', error);
}
Expand Down
2 changes: 1 addition & 1 deletion app/(main)/league/[leagueId]/entry/all/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ const Entry = ({
const selectedTeam = entry.selectedTeams[currentWeek - 1];
const isPickSet =
// eslint-disable-next-line no-undefined
selectedTeam !== undefined;
selectedTeam !== null && selectedTeam !== undefined;

const teamLogo = NFLTeams.find(
(teams) => teams.teamName === selectedTeam,
Expand Down
1 change: 0 additions & 1 deletion app/(main)/register/page.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ describe('Register', () => {
password: 'pw1234',
confirmPassword: 'pw1234',
});
expect(mockPush).toHaveBeenCalledWith('/league/all');
expect(toast.custom).toHaveBeenCalledWith(
<Alert
variant={AlertVariants.Success}
Expand Down
1 change: 0 additions & 1 deletion app/(main)/register/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ const Register = (): JSX.Element => {
try {
await registerAccount(data);
await login(data);
router.push('/league/all');
toast.custom(
<Alert
variant={AlertVariants.Success}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,4 @@
"ts-node": "^10.9.2",
"typescript": "5.1.3"
}
}
}

0 comments on commit 6ce440d

Please sign in to comment.