code tweaks

This commit is contained in:
Thibault Duplessis 2018-03-09 14:07:33 -05:00
parent 9f9fd389cb
commit acf2ff07ef
2 changed files with 2 additions and 2 deletions

View file

@ -80,7 +80,7 @@ private[round] object History {
coll.byId[Bdoc](gameId).map {
_.flatMap(_.getAs[VersionedEvents]("e")) ?? (_.reverse)
} addEffect {
case events if events.nonEmpty && !withPersistence => coll.remove($doc("_id" -> gameId)).void
case events if events.nonEmpty && !withPersistence => coll.remove($id(gameId)).void
case _ =>
}

View file

@ -60,7 +60,7 @@ trait Positional { self: Config =>
}
def fenGame(builder: ChessGame => Game): Game = {
val baseState = fen ifTrue (variant == FromPosition) flatMap {
val baseState = fen ifTrue (variant.fromPosition) flatMap {
Forsyth.<<<@(FromPosition, _)
}
val (chessGame, state) = baseState.fold(makeGame -> none[SituationPlus]) {