Skip to content

Commit

Permalink
fix: MenuItem
Browse files Browse the repository at this point in the history
  • Loading branch information
lee-to committed Sep 17, 2024
1 parent 6861a8d commit 6e76945
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/MenuManager/src/MenuItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ public function getFiller(): MenuFillerContract|Closure|string
return $this->filler;
}

/**
* @param Closure(string $path, string $host, static $ctx): bool $when
*/
public function whenActive(Closure $when): static
{
$this->whenActive = $when;
Expand Down Expand Up @@ -131,7 +134,7 @@ public function isActive(): bool
{
$filler = $this->getFiller();

if ($filler instanceof MenuFillerContract) {
if ($filler instanceof MenuFillerContract && is_null($this->whenActive)) {
return $filler->isActive();
}

Expand Down

0 comments on commit 6e76945

Please sign in to comment.