mirror of
https://github.com/HangarMC/Hangar.git
synced 2024-11-21 01:21:54 +08:00
Remove invalid versions when filtering platforms (#801)
This commit is contained in:
parent
571c2cad5c
commit
451056ce1e
@ -89,6 +89,15 @@ function versions(platform: Platform) {
|
||||
});
|
||||
}
|
||||
|
||||
function updatePlatform(platform: any) {
|
||||
filters.value.platform = platform;
|
||||
|
||||
const allowedVersion = versions(platform);
|
||||
filters.value.versions = filters.value.versions.filter((existingVersion) => {
|
||||
return allowedVersion.find((allowedNewVersion) => allowedNewVersion.version === existingVersion);
|
||||
});
|
||||
}
|
||||
|
||||
const meta = useSeo("Home", null, route, null);
|
||||
const script = {
|
||||
type: "application/ld+json",
|
||||
@ -167,7 +176,7 @@ useHead(meta);
|
||||
<div class="flex flex-col gap-1">
|
||||
<ul>
|
||||
<li v-for="platform in backendData.visiblePlatforms" :key="platform.enumName" class="inline-flex w-full">
|
||||
<InputRadio v-model="filters.platform" :value="platform.enumName" :label="platform.name">
|
||||
<InputRadio :label="platform.name" :model-value="filters.platform" :value="platform.enumName" @update:modelValue="updatePlatform">
|
||||
<PlatformLogo :platform="platform.enumName" :size="24" class="mr-1" />
|
||||
</InputRadio>
|
||||
</li>
|
||||
|
Loading…
Reference in New Issue
Block a user