Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

Commit

Permalink
fix(consultation): correct the logic if consultation will soon start
Browse files Browse the repository at this point in the history
  • Loading branch information
KennethTrecy committed Sep 17, 2022
1 parent 1ab45de commit 9070ecf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion components/consultation/chat_window.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ function finishConsultation() {
const { startedAt } = consultation
if (startedAt instanceof Date) {
console.log("after update but bfore reupdate", props, startedAt, "\n\n\n\n")
const newConsultationData: ConsultationAttributes<"serialized"> = {
"actionTaken": null,
"deletedAt": consultation.deletedAt?.toISOString() ?? null,
Expand Down
5 changes: 2 additions & 3 deletions components/consultation/chat_window/user_controller.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,12 @@ const differenceFromSchedule = computed<number>(() => calculateMillisecondDiffer
props.consultation.scheduledStartAt,
currentTime.value
))
const isAfterScheduledStart = computed<boolean>(() => differenceFromSchedule.value
< 0)
const isAfterScheduledStart = computed<boolean>(() => differenceFromSchedule.value < 0)
const hasStarted = computed<boolean>(() => props.consultation.startedAt !== null)
const hasFinished = computed<boolean>(() => props.consultation.finishedAt !== null)
const hasDeleted = computed<boolean>(() => props.consultation.deletedAt !== null)
const willSoonStart = computed<boolean>(() => differenceFromSchedule.value < 0)
const willSoonStart = computed<boolean>(() => differenceFromSchedule.value > 0)
const willStart = computed<boolean>(() => {
const mayStart = differenceFromSchedule.value === 0 || isAfterScheduledStart.value
return mayStart && !hasStarted.value
Expand Down

0 comments on commit 9070ecf

Please sign in to comment.