Expectations finale
This commit is contained in:
1 parent
2c641b5507
commit
bbd6251020
3 files changed
+267
-74
No files matched your search
@@ -119,7 +119,11 @@ class PlayerProps extends Page implements HasForms
|
||||
})
|
||||
->afterStateUpdated(function (callable $set, $state) {
|
||||
$set('tid', null);
|
||||
$this->dispatch('match-update', match_id: $state);
|
||||
if ($state) {
|
||||
$this->dispatch('match-update', match_id: $state);
|
||||
} else {
|
||||
$this->dispatch('clear-all');
|
||||
}
|
||||
})
|
||||
->placeholder('Events'),
|
||||
|
||||
@@ -142,7 +146,9 @@ class PlayerProps extends Page implements HasForms
|
||||
}
|
||||
})
|
||||
->placeholder('Team')->afterStateUpdated(function ($state) {
|
||||
$this->dispatch('team-update', team_id: $state);
|
||||
if ($state) {
|
||||
$this->dispatch('team-update', team_id: $state);
|
||||
}
|
||||
}),
|
||||
Select::make('lineup')
|
||||
->live()
|
||||
@@ -175,10 +181,15 @@ class PlayerProps extends Page implements HasForms
|
||||
}
|
||||
|
||||
#[On('team-update')]
|
||||
public function syncData(int $team_id)
|
||||
public function syncData(?int $team_id)
|
||||
{
|
||||
$this->team_id = $team_id;
|
||||
$this->clientLineUps = SsLineupMemory::where('team_id', $team_id)->where('client_id', Auth::user()->client_id)->pluck('lineup')->toArray();
|
||||
if ($team_id) {
|
||||
$this->team_id = $team_id;
|
||||
$this->clientLineUps = SsLineupMemory::where('team_id', $team_id)->where('client_id', Auth::user()->client_id)->pluck('lineup')->toArray();
|
||||
} else {
|
||||
$this->players = [];
|
||||
$this->dispatch('clear-all');
|
||||
}
|
||||
}
|
||||
|
||||
#[On('update-players')]
|
||||
|
||||
Reference in new issue
Block a user