Skip to content

Commit

Permalink
Merge pull request #24 from lugvitc/main
Browse files Browse the repository at this point in the history
Hotfix unhandled undefined in SlotSelect
  • Loading branch information
WizzyGeek authored Jul 4, 2024
2 parents aed942d + 6b04893 commit fd2d4ef
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"dev": "vite",
"build": "tsc && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
"preview": "vite preview --port 5173"
},
"dependencies": {
"@react-three/fiber": "^8.16.8",
Expand Down
5 changes: 5 additions & 0 deletions src/pages/book.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ function SlotSelect({ap, rawSlots}: {ap: App, rawSlots: Slot[]}) {

if (ap.slot !== null) {
const k = rawSlots.find((sl) => sl.id === ap.slot)
if(k === undefined){
return (
<div>Something went wrong, please go back to the home page and then click "book" on the top right</div>
)
}
return (
<div>Your slot has been booked for <span className="italic">{k!.timing}</span></div>
)
Expand Down

0 comments on commit fd2d4ef

Please sign in to comment.