MAPG-235 timeLimit restored after reload of the page. Time limit selector usability improved

This commit is contained in:
balazs committed 2021-05-21 11:30:30 +02:00
1 parent b78d564f6f
commit aadeda05af
5 files changed
+26 -4

No files matched your search

+5
View File
@@ -239,6 +239,11 @@ class GameFlowController
$response = $this->prepareChallengeResponse($userId, $challenge, $currentRound, true);
if ($challenge->getTimeLimitType() === 'game' && $userInChallenge->getCurrentRound() > 0) {
$timeLimit = max(10, $userInChallenge->getTimeLeft());
$response['restrictions']['timeLimit'] = $timeLimit * 1000;
}
return new JsonContent($response);
}
+1 -1
View File
@@ -50,7 +50,7 @@ class UserInChallenge extends Model
public function setTimeLeft(?int $timeLeft): void
{
if(isset($timeLeft)) {
$this->timeLeft = $timeLeft;
$this->timeLeft = max(0, $timeLeft);
}
}