Skip to content

Commit

Permalink
fix: prevent medals changing due to async match history (#167)
Browse files Browse the repository at this point in the history
  • Loading branch information
iBotPeaches authored Jan 16, 2022
1 parent 42b28a4 commit 0c2b075
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/Http/Livewire/GamePage.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ public function render(): View
{
$groupedPlayers = $this->game->players->groupBy('game_team_id');

$this->game->players
->each(function (GamePlayer $gamePlayer) {
if (! $this->game->outdated) {
$this->game->players->each(function (GamePlayer $gamePlayer) {
$gamePlayer->hydrated_medals->filter(function (Medal $medal) {
return $medal->type->in([
MedalType::LEGENDARY(),
Expand All @@ -40,6 +40,7 @@ public function render(): View
$this->powerfulMedals[$medal->id]['players'][$gamePlayer->id] = $gamePlayer;
});
});
}

return view('livewire.game-page', [
'game' => $this->game,
Expand Down

0 comments on commit 0c2b075

Please sign in to comment.