remember challenge setup
This commit is contained in:
parent
a400acd9cb
commit
3c77f02354
|
@ -94,9 +94,10 @@ object Setup extends LilaController with TheftPrevention {
|
|||
case _ => Left("no_sid")
|
||||
},
|
||||
destUser = destUser)
|
||||
(Env.challenge.api create challenge) >> negotiate(
|
||||
html = fuccess(Redirect(routes.Round.watcher(challenge.id, "white"))),
|
||||
api = _ => Challenge showChallenge challenge)
|
||||
env.processor.saveFriendConfig(config) >>
|
||||
(Env.challenge.api create challenge) >> negotiate(
|
||||
html = fuccess(Redirect(routes.Round.watcher(challenge.id, "white"))),
|
||||
api = _ => Challenge showChallenge challenge)
|
||||
}
|
||||
}
|
||||
)
|
||||
|
|
|
@ -62,6 +62,9 @@ private[setup] final class Processor(
|
|||
}
|
||||
}
|
||||
|
||||
def saveFriendConfig(config: FriendConfig)(implicit ctx: UserContext) =
|
||||
saveConfig(_ withFriend config)
|
||||
|
||||
private def saveConfig(map: UserConfig => UserConfig)(implicit ctx: UserContext): Funit =
|
||||
ctx.me.fold(AnonConfigRepo.update(ctx.req) _)(user => UserConfigRepo.update(user) _)(map)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue