From ffd511702803f013277c074314d919499f1a052b Mon Sep 17 00:00:00 2001 From: Refringe Date: Sun, 8 Sep 2024 22:00:26 -0400 Subject: [PATCH] Renames $availableSptVersions to $activeSptVersions in Mod Listing --- app/Livewire/Mod/Index.php | 6 +++--- resources/views/livewire/mod/index.blade.php | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/Livewire/Mod/Index.php b/app/Livewire/Mod/Index.php index 5760c14..f8d8b58 100644 --- a/app/Livewire/Mod/Index.php +++ b/app/Livewire/Mod/Index.php @@ -48,14 +48,14 @@ class Index extends Component /** * The available SPT versions. */ - public Collection $availableSptVersions; + public Collection $activeSptVersions; /** * The component mount method, run only once when the component is mounted. */ public function mount(): void { - $this->availableSptVersions = $this->availableSptVersions ?? Cache::remember('available-spt-versions', 60 * 60, function () { + $this->activeSptVersions = $this->activeSptVersions ?? Cache::remember('active-spt-versions', 60 * 60, function () { return SptVersion::getVersionsForLastThreeMinors(); }); @@ -67,7 +67,7 @@ class Index extends Component */ public function getLatestMinorVersions(): Collection { - return $this->availableSptVersions->filter(function (SptVersion $sptVersion) { + return $this->activeSptVersions->filter(function (SptVersion $sptVersion) { return $sptVersion->isLatestMinor(); }); } diff --git a/resources/views/livewire/mod/index.blade.php b/resources/views/livewire/mod/index.blade.php index 1761406..b8167e4 100644 --- a/resources/views/livewire/mod/index.blade.php +++ b/resources/views/livewire/mod/index.blade.php @@ -53,13 +53,13 @@
@php - $totalVersions = count($availableSptVersions); + $totalVersions = count($activeSptVersions); $half = ceil($totalVersions / 2); @endphp
{{ __('SPT Versions') }}
- @foreach ($availableSptVersions as $index => $version) + @foreach ($activeSptVersions as $index => $version) @if ($index < $half) {{ $version->version }} @endif @@ -69,7 +69,7 @@
 
- @foreach ($availableSptVersions as $index => $version) + @foreach ($activeSptVersions as $index => $version) @if ($index >= $half) {{ $version->version }} @endif