Skip to content

Commit

Permalink
Return error message Element instead of null if getting chargers fails
Browse files Browse the repository at this point in the history
  • Loading branch information
boyonthebeach2k committed Jun 30, 2024
1 parent 3791f90 commit 27b6f89
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ const App = (props: InferGetStaticPropsType<typeof getStaticProps>) => {
setKey(tab);
};

if (chargersProps === undefined) return null;
if (chargersProps === undefined) return <p>There was a problem loading props for the page.</p>;

let { chargers, selfChargeAOE, selfChargeST, selfChargeSupport, partyCharge, allyCharge }: CategorizedChargeInfo =
chargersProps[region];

if (chargers === undefined) return null;
if (chargers === undefined) return <p>There was a problem loading chargers.</p>;

return (
<>
Expand Down

0 comments on commit 27b6f89

Please sign in to comment.