File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import clsx from "clsx"
6
6
import { metadata as layoutMetadata } from "@/app/conf/2023/layout"
7
7
8
8
import { speakers , schedule } from "../../_data"
9
- import { ScheduleSession } from "../../../2023/types"
9
+ import { SchedSpeaker , ScheduleSession } from "../../../2023/types"
10
10
11
11
import { findVideo , SessionVideo } from "./session-video"
12
12
import { NavbarPlaceholder } from "../../components/navbar"
@@ -55,10 +55,15 @@ export default function SessionPage({ params }: SessionProps) {
55
55
notFound ( )
56
56
}
57
57
58
- // @ts -expect-error -- fixme
59
- session . speakers = ( session . speakers || [ ] ) . map ( speaker =>
60
- speakers . find ( s => s . username === speaker . username ) ,
61
- )
58
+ session . speakers = ( session . speakers || [ ] ) . map ( speaker => {
59
+ const found = speakers . find ( s => s . username === speaker . username )
60
+ if ( ! found ) {
61
+ throw new Error (
62
+ `Speaker "${ speaker . username } " not found for "${ session . name } "` ,
63
+ )
64
+ }
65
+ return found
66
+ } )
62
67
63
68
const eventTitle = getEventTitle (
64
69
session ,
Original file line number Diff line number Diff line change @@ -17,4 +17,4 @@ export function readSpeakers(year: ConferenceYear): SchedSpeaker[] {
17
17
}
18
18
19
19
// TODO: We need to be able to say that a speaker is returning even if they don't share username, only first name and last name.
20
- // But this needs to be done without adding to `~years ` so we don't show duplicates.
20
+ // But this needs to be done without adding to `_years ` so we don't show duplicates.
You can’t perform that action at this time.
0 commit comments