mirror of
https://github.com/sp-tarkov/forge.git
synced 2025-02-12 20:20:41 -05:00
Mod Listing Page - Default Value Method
Small refactor to use a method to fetch the default value for SPT Version filters.
This commit is contained in:
parent
75b8be1e1e
commit
b895cdc922
@ -76,7 +76,15 @@ class Listing extends Component
|
||||
return SptVersion::getVersionsForLastThreeMinors();
|
||||
});
|
||||
|
||||
$this->sptVersions = $this->sptVersions ?? $this->getLatestMinorVersions()->pluck('version')->toArray();
|
||||
$this->sptVersions = $this->sptVersions ?? $this->getDefaultSptVersions();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the default values for the SPT Versions filter.
|
||||
*/
|
||||
protected function getDefaultSptVersions(): array
|
||||
{
|
||||
return $this->getLatestMinorVersions()->pluck('version')->toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -145,7 +153,7 @@ class Listing extends Component
|
||||
public function resetFilters(): void
|
||||
{
|
||||
$this->query = '';
|
||||
$this->sptVersions = $this->getLatestMinorVersions()->pluck('version')->toArray();
|
||||
$this->sptVersions = $this->getDefaultSptVersions();
|
||||
$this->featured = 'include';
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user