mirror of
https://github.com/rommapp/romm.git
synced 2026-12-05 05:07:31 +01:00
Fix storage bugs from refactor
This commit is contained in:
@@ -36,7 +36,7 @@ emitter.on("refreshGallery", () => {
|
||||
onMounted(async () => {
|
||||
try {
|
||||
const { data } = await fetchPlatformsApi();
|
||||
platforms.set(data.data);
|
||||
platforms.set(data);
|
||||
} catch (error) {
|
||||
console.error("Couldn't fetch platforms:", error);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<script setup>
|
||||
import { inject, ref, onMounted } from "vue";
|
||||
import { debounce } from "lodash";
|
||||
import storeGalleryFilter from "@/stores/galleryFilter.js";
|
||||
|
||||
// Props
|
||||
|
||||
@@ -3,20 +3,15 @@ import { defineStore } from "pinia";
|
||||
export default defineStore("platforms", {
|
||||
state: () => {
|
||||
return {
|
||||
platforms: []
|
||||
value: [],
|
||||
};
|
||||
},
|
||||
getters: {
|
||||
totalGames: ({ platforms }) => {
|
||||
debugger;
|
||||
platforms?.reduce((count, p) => {
|
||||
return count + p.n_roms;
|
||||
}, 0) ?? 0;
|
||||
},
|
||||
totalGames: ({ value }) => value.reduce((count, p) => count + p.n_roms, 0),
|
||||
},
|
||||
actions: {
|
||||
set(platforms) {
|
||||
this.platforms = platforms;
|
||||
this.value = platforms;
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
@@ -5,6 +5,7 @@ import { fetchRomsApi } from "@/services/api.js";
|
||||
import socket from "@/services/socket.js";
|
||||
import { views } from "@/utils/utils.js";
|
||||
import storeGalleryFilter from "@/stores/galleryFilter.js";
|
||||
import storeGalleryView from "@/stores/galleryView.js";
|
||||
import storeScanning from "@/stores/scanning.js";
|
||||
import FilterBar from "@/components/GalleryAppBar/FilterBar.vue";
|
||||
import GalleryViewBtn from "@/components/GalleryAppBar/GalleryViewBtn.vue";
|
||||
@@ -17,6 +18,7 @@ const route = useRoute();
|
||||
const roms = ref([]);
|
||||
const searchRoms = ref([]);
|
||||
const filteredRoms = ref([]);
|
||||
const galleryView = storeGalleryView();
|
||||
const galleryFilter = storeGalleryFilter();
|
||||
const gettingRoms = ref(false);
|
||||
const scanning = storeScanning();
|
||||
|
||||
Reference in New Issue
Block a user