all filters fully functional. reporting system added. multiple fixes. #27

Merged
freakoverse merged 13 commits from staging into master 2024-08-29 17:40:03 +00:00
3 changed files with 7 additions and 9 deletions
Showing only changes of commit 1259144228 - Show all commits

6
package-lock.json generated
View File

@ -3808,9 +3808,9 @@
} }
}, },
"node_modules/micromatch": { "node_modules/micromatch": {
"version": "4.0.7", "version": "4.0.8",
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz",
"integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==", "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"braces": "^3.0.3", "braces": "^3.0.3",

View File

@ -85,7 +85,7 @@ export const ModsPage = () => {
setIsFetching(true) setIsFetching(true)
const until = const until =
mods.length > 0 ? mods[mods.length - 1].edited_at - 1 : undefined mods.length > 0 ? mods[mods.length - 1].published_at - 1 : undefined
fetchMods(filterOptions.source, until) fetchMods(filterOptions.source, until)
.then((res) => { .then((res) => {
@ -100,7 +100,7 @@ export const ModsPage = () => {
const handlePrev = useCallback(() => { const handlePrev = useCallback(() => {
setIsFetching(true) setIsFetching(true)
const since = mods.length > 0 ? mods[0].edited_at + 1 : undefined const since = mods.length > 0 ? mods[0].published_at + 1 : undefined
fetchMods(filterOptions.source, undefined, since) fetchMods(filterOptions.source, undefined, since)
.then((res) => { .then((res) => {
@ -139,9 +139,9 @@ export const ModsPage = () => {
} }
if (filterOptions.sort === SortBy.Latest) { if (filterOptions.sort === SortBy.Latest) {
filtered.sort((a, b) => b.edited_at - a.edited_at) filtered.sort((a, b) => b.published_at - a.published_at)
} else if (filterOptions.sort === SortBy.Oldest) { } else if (filterOptions.sort === SortBy.Oldest) {
filtered.sort((a, b) => a.edited_at - b.edited_at) filtered.sort((a, b) => a.published_at - b.published_at)
} }
return filtered return filtered

View File

@ -167,8 +167,6 @@ export const fetchMods = async (
return RelayController.getInstance() return RelayController.getInstance()
.fetchEvents(filter, []) // Pass the filter and an empty array of options .fetchEvents(filter, []) // Pass the filter and an empty array of options
.then((events) => { .then((events) => {
console.log('events :>> ', events)
// Convert the fetched events into a list of mods // Convert the fetched events into a list of mods
const modList = constructModListFromEvents(events) const modList = constructModListFromEvents(events)
return modList // Return the list of mods return modList // Return the list of mods