remove owned_by_current_user and refactor

This commit is contained in:
Georges-Antoine Assi
2026-02-08 19:58:28 -05:00
parent 3da557c72d
commit 0023e29ef8
11 changed files with 11 additions and 25 deletions

View File

@@ -21,6 +21,5 @@ export type CollectionSchema = {
url_cover: (string | null);
user_id: number;
owner_username: string;
owned_by_current_user: boolean;
};

View File

@@ -22,6 +22,5 @@ export type SmartCollectionSchema = {
filter_summary: string;
user_id: number;
owner_username: string;
owned_by_current_user: boolean;
};

View File

@@ -27,9 +27,7 @@ async function fetchRoms() {
});
romsStore
.fetchRoms({
concat: false,
})
.fetchRoms(false)
.then(() => {
emitter?.emit("showLoadingDialog", {
loading: false,

View File

@@ -86,9 +86,7 @@ const emitter = inject<Emitter<Events>>("emitter");
const onFilterChange = debounce(
() => {
romsStore.resetPagination();
romsStore.fetchRoms({
concat: false,
});
romsStore.fetchRoms(false);
const url = new URL(window.location.href);
// Update URL with filters

View File

@@ -43,9 +43,7 @@ const onFilterChange = debounce(
() => {
romsStore.resetPagination();
galleryFilterStore.setFilterMissing(true);
romsStore.fetchRoms({
concat: false,
});
romsStore.fetchRoms(false);
const url = new URL(window.location.href);
// Update URL with filters
@@ -73,7 +71,7 @@ async function fetchRoms() {
galleryFilterStore.setFilterMissing(true);
romsStore
.fetchRoms({})
.fetchRoms()
.catch((error) => {
console.error("Error fetching missing games:", error);
emitter?.emit("snackbarShow", {
@@ -93,7 +91,7 @@ function cleanupAll() {
romsStore.setLimit(10000);
galleryFilterStore.setFilterMissing(true);
romsStore
.fetchRoms({})
.fetchRoms()
.then(() => {
emitter?.emit("showLoadingDialog", {
loading: false,

View File

@@ -136,7 +136,7 @@ function updateOptions({ sortBy }: { sortBy: SortBy }) {
romsStore.resetPagination();
romsStore.setOrderBy(key);
romsStore.setOrderDir(order);
romsStore.fetchRoms({});
romsStore.fetchRoms();
}
</script>

View File

@@ -318,9 +318,7 @@ async function fetchRoms() {
romsStore.setOrderDir("asc");
romsStore.resetPagination();
const fetchedRoms = await romsStore.fetchRoms({
concat: false,
});
const fetchedRoms = await romsStore.fetchRoms(false);
if (selectedIndex.value >= fetchedRoms.length) selectedIndex.value = 0;
await nextTick();

View File

@@ -193,11 +193,7 @@ export default defineStore("roms", {
galleryFilter.setFilterPlayerCounts(filter_values.player_counts);
}
},
async fetchRoms({
concat = true,
}: {
concat?: boolean;
}): Promise<SimpleRom[]> {
async fetchRoms(concat = true): Promise<SimpleRom[]> {
if (this.fetchingRoms) return Promise.resolve([]);
this.fetchingRoms = true;

View File

@@ -53,7 +53,7 @@ async function fetchRoms() {
});
romsStore
.fetchRoms({})
.fetchRoms()
.then(() => {
emitter?.emit("showLoadingDialog", {
loading: false,

View File

@@ -48,7 +48,7 @@ async function fetchRoms() {
});
romsStore
.fetchRoms({})
.fetchRoms()
.then(() => {
emitter?.emit("showLoadingDialog", {
loading: false,

View File

@@ -99,7 +99,7 @@ function onGameTouchEnd() {
}
function fetchRoms() {
romsStore.fetchRoms({}).catch((error) => {
romsStore.fetchRoms().catch((error) => {
emitter?.emit("snackbarShow", {
msg: `Couldn't fetch roms: ${error}`,
icon: "mdi-close-circle",