File tree Expand file tree Collapse file tree
src/containers/PersonalSchedule Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -105,20 +105,24 @@ const getFmcAttemptAssignments = (wcif: Competition, person: Person) => {
105105 return parsed . eventId === '333fm' && parsed . attemptNumber !== null ;
106106 } ) ;
107107
108- return fmcAttemptActivities . map (
109- (
110- activity ,
111- ) : Assignment & {
112- type : 'extra' ;
113- activity : Activity ;
114- } => ( {
115- type : 'extra' ,
116- assignmentCode : 'competitor' ,
117- activityId : activity . id ,
118- stationNumber : null ,
119- activity,
120- } ) ,
121- ) ;
108+ const personActivities = person . assignments ?. map ( ( ass ) => ass . activityId ) ;
109+
110+ return fmcAttemptActivities
111+ . filter ( ( activity ) => personActivities ?. includes ( activity . id ) )
112+ . map (
113+ (
114+ activity ,
115+ ) : Assignment & {
116+ type : 'extra' ;
117+ activity : Activity ;
118+ } => ( {
119+ type : 'extra' ,
120+ assignmentCode : 'competitor' ,
121+ activityId : activity . id ,
122+ stationNumber : null ,
123+ activity,
124+ } ) ,
125+ ) ;
122126} ;
123127
124128export const getAllAssignments = ( wcif : Competition , person : Person ) => {
You can’t perform that action at this time.
0 commit comments