Skip to content

Commit

Permalink
fix: timeRemaining (#10316)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattkrick authored Oct 8, 2024
1 parent fff7383 commit de9df6c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions packages/server/graphql/public/types/NewMeetingStage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,15 @@ const NewMeetingStage: NewMeetingStageResolvers = {
return readyToAdvance.filter((userId: string) => userId !== facilitatorUserId).length
},

timeRemaining: ({scheduledEndTime}) => {
return scheduledEndTime ? scheduledEndTime.valueOf() - Date.now() : null
timeRemaining: ({scheduledEndTime, id, meetingId}) => {
if (scheduledEndTime) {
if (!(scheduledEndTime instanceof Date)) {
console.log('ENDTIME NOT DATE', scheduledEndTime, id, meetingId)
return null
}
return scheduledEndTime.getTime() - Date.now()
}
return null
}
}

Expand Down

0 comments on commit de9df6c

Please sign in to comment.