diff --git a/frontend/src/components/Home/Platforms.vue b/frontend/src/components/Home/Platforms.vue index f7168a2ab..900eae25a 100644 --- a/frontend/src/components/Home/Platforms.vue +++ b/frontend/src/components/Home/Platforms.vue @@ -5,10 +5,12 @@ import storePlatforms from "@/stores/platforms"; import { isNull } from "lodash"; import { views } from "@/utils"; import { useI18n } from "vue-i18n"; +import { storeToRefs } from "pinia"; // Props const { t } = useI18n(); -const platforms = storePlatforms(); +const platformsStore = storePlatforms(); +const { filledPlatforms } = storeToRefs(platformsStore); const gridPlatforms = isNull(localStorage.getItem("settings.gridPlatforms")) ? true : localStorage.getItem("settings.gridPlatforms") === "true"; @@ -21,7 +23,7 @@ const gridPlatforms = isNull(localStorage.getItem("settings.gridPlatforms")) no-gutters > a.name.localeCompare(b.name)), }), diff --git a/frontend/src/stores/platforms.ts b/frontend/src/stores/platforms.ts index 085ecd507..c19da4cd6 100644 --- a/frontend/src/stores/platforms.ts +++ b/frontend/src/stores/platforms.ts @@ -15,7 +15,9 @@ export default defineStore("platforms", { totalGames: ({ allPlatforms: value }) => value.reduce((count, p) => count + p.rom_count, 0), filledPlatforms: ({ allPlatforms: all }) => - all.filter((p) => p.rom_count > 0), + all + .filter((p) => p.rom_count > 0) + .sort((a, b) => a.display_name.localeCompare(b.display_name)), filteredPlatforms: ({ allPlatforms: all, searchText }) => all .filter(