Skip to content

Commit

Permalink
set initial tour.ongoing
Browse files Browse the repository at this point in the history
  • Loading branch information
ornicar committed Jun 16, 2024
1 parent 50a80a8 commit e64b23b
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions modules/relay/src/main/RelayApi.scala
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,9 @@ final class RelayApi(
def create(data: RelayRoundForm.Data, tour: RelayTour)(using me: Me): Fu[RelayRound.WithTourAndStudy] =
roundRepo
.lastByTour(tour)
.flatMapz { last =>
.flatMapz: last =>
studyRepo.byId(last.studyId)
}
.flatMap { lastStudy =>
.flatMap: lastStudy =>
import lila.study.{ StudyMember, StudyMembers }
val relay = data.make(me, tour)
for
Expand Down Expand Up @@ -226,10 +225,9 @@ final class RelayApi(
)
.orFail(s"Can't create study for relay $relay")
_ <- roundRepo.coll.insert.one(relay)
_ <- tourRepo.setActive(tour.id, true)
_ <- tourRepo.setActive(tour.id, true, relay.hasStarted)
_ <- studyApi.addTopics(relay.studyId, List(StudyTopic.broadcast.value))
yield relay.withTour(tour).withStudy(study.study)
}

def requestPlay(id: RelayRoundId, v: Boolean): Funit =
WithRelay(id): relay =>
Expand Down

0 comments on commit e64b23b

Please sign in to comment.