Skip to content

Commit 5069b13

Browse files
committed
fix: rip out the pagination on user pages
1 parent 608361d commit 5069b13

File tree

1 file changed

+2
-18
lines changed

1 file changed

+2
-18
lines changed

app/pages/~[username]/index.vue

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@ const router = useRouter()
77
88
const username = computed(() => route.params.username.toLowerCase())
99
10-
// Debounced URL update for page and filter/sort
11-
const updateUrl = debounce((updates: { page?: number; filter?: string; sort?: string }) => {
10+
// Debounced URL update for filter/sort
11+
const updateUrl = debounce((updates: { filter?: string; sort?: string }) => {
1212
router.replace({
1313
query: {
1414
...route.query,
15-
page: updates.page && updates.page > 1 ? updates.page : undefined,
1615
q: updates.filter || undefined,
1716
sort: updates.sort && updates.sort !== 'downloads' ? updates.sort : undefined,
1817
},
@@ -37,16 +36,8 @@ watch([filterText, sortOption], ([filter, sort]) => {
3736
debouncedUpdateUrl(filter, sort)
3837
})
3938
40-
// Fetch packages from npm registry (same endpoint as org page, but
41-
// unknown users get empty results instead of a 404 error page)
4239
const { data: results, status, error } = useUserPackages(username)
4340
44-
// Get initial page from URL (for scroll restoration on reload)
45-
const initialPage = computed(() => {
46-
const p = Number.parseInt(normalizeSearchParam(route.query.page), 10)
47-
return Number.isNaN(p) ? 1 : Math.max(1, p)
48-
})
49-
5041
// Get the base packages list
5142
const packages = computed(() => results.value?.objects ?? [])
5243
@@ -97,11 +88,6 @@ const totalWeeklyDownloads = computed(() =>
9788
filteredAndSortedPackages.value.reduce((sum, pkg) => sum + (pkg.downloads?.weekly ?? 0), 0),
9889
)
9990
100-
// Update URL when page changes from scrolling
101-
function handlePageChange(page: number) {
102-
updateUrl({ page, filter: filterText.value, sort: sortOption.value })
103-
}
104-
10591
// Reset state when username changes
10692
watch(username, () => {
10793
filterText.value = ''
@@ -206,8 +192,6 @@ defineOgImageComponent('Default', {
206192
<PackageList
207193
v-else
208194
:results="filteredAndSortedPackages"
209-
:initial-page="initialPage"
210-
@page-change="handlePageChange"
211195
/>
212196
</section>
213197

0 commit comments

Comments
 (0)