mirror of
https://github.com/ericasch6/scrum-poker-internal.git
synced 2026-10-13 21:12:10 +00:00
fix: refactored the codebase
This commit is contained in:
@@ -45,7 +45,9 @@ class EnsureRoomParticipant
|
||||
|
||||
$playerId = $request->session()->get($sessionKey);
|
||||
|
||||
$player = $playerId ? $room->players()->find($playerId) : null;
|
||||
$player = is_numeric($playerId)
|
||||
? $room->players()->find((int) $playerId)
|
||||
: null;
|
||||
|
||||
if ($player === null && $playerId) {
|
||||
$request->session()->forget($sessionKey);
|
||||
@@ -69,6 +71,13 @@ class EnsureRoomParticipant
|
||||
]);
|
||||
}
|
||||
|
||||
if ($player->inactive_at !== null) {
|
||||
return to_route('room.join', [
|
||||
'join_code' => $room->join_code,
|
||||
]);
|
||||
}
|
||||
|
||||
$player->markAsSeen();
|
||||
$request->attributes->set('currentPlayer', $player);
|
||||
|
||||
return $next($request);
|
||||
|
||||
Reference in New Issue
Block a user