Skip to content

Commit 749c191

Browse files
committed
fix typeerrors
1 parent d199af0 commit 749c191

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

client/src/pages/OngoingBattle.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export default function OngoingBattle({
2626
>({
2727
queryKey: ["battles", battle.id, "problems"],
2828
queryFn: async () => {
29+
if (!auth.authed) return []
2930
const response = await auth.fetch(`${BASE_API_URL}/api/battle/${battle.id}/problems`, {
3031
headers: {
3132
"Content-Type": "application/json",
@@ -55,6 +56,7 @@ export default function OngoingBattle({
5556
>({
5657
queryKey: ["battles", battle.id, "standings"],
5758
queryFn: async () => {
59+
if (!auth.authed) return []
5860
const response = await auth.fetch(`${BASE_API_URL}/api/battle/${battle.id}/standings`, {
5961
headers: {
6062
"Content-Type": "application/json",
@@ -72,6 +74,7 @@ export default function OngoingBattle({
7274
>({
7375
queryKey: ["battles", battle.id, "submissions"],
7476
queryFn: async () => {
77+
if (!auth.authed) return []
7578
const response = await auth.fetch(`${BASE_API_URL}/api/battle/${battle.id}/submissions`, {
7679
headers: {
7780
"Content-Type": "application/json",

client/src/pages/UpcomingBattle.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export default function UpcomingBattle({
2929
const { data: battlePlayers, status } = useQuery<User[]>({
3030
queryKey: ["battleParticipants", battle.id],
3131
queryFn: async () => {
32+
if (!auth.authed) return []
3233
const response = await auth.fetch(
3334
`${BASE_API_URL}/api/battle/${battle.id}/participants`,
3435
{

0 commit comments

Comments
 (0)