Skip to content

Commit

Permalink
Shift auxiliary return path to helper method
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Mar 22, 2024
1 parent ff21524 commit 44b901e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public function isGroupActive(string $group): bool
protected function legacy_isGroupActive(string $group, HydePage $currentPage): bool
{
if ($this->isCurrentPageIndexPage($currentPage)) {
return $this->shouldIndexPageBeActive($group, $currentPage) || $this->groupMatchesCurrentPageGroup($currentPage, $group);
return $this->shouldIndexPageBeActive($group, $currentPage);
}

return $this->groupMatchesCurrentPageGroup($currentPage, $group);
Expand All @@ -112,7 +112,7 @@ private function shouldIndexPageBeActive(string $group, HydePage $currentPage):
return false;
}

return $group === $this->getItems()->firstOrFail()->getGroupKey();
return ($group === $this->getItems()->firstOrFail()->getGroupKey()) || $this->groupMatchesCurrentPageGroup($currentPage, $group);
}

protected function groupMatchesCurrentPageGroup(HydePage $currentPage, string $group): bool
Expand Down

0 comments on commit 44b901e

Please sign in to comment.