Preserve existing skip value when navigating to the next matching item
This commit is contained in:
@@ -153,7 +153,13 @@
|
||||
const params = new URLSearchParams();
|
||||
if (activeCategory) params.set('category', activeCategory);
|
||||
if (activeStatus) params.set('status', activeStatus);
|
||||
// Next navigates to the next matching item (no skip)
|
||||
// Preserve any existing skip value from current URL so the caller's
|
||||
// skip position isn't lost when moving to the next item.
|
||||
const curParams = new URLSearchParams(window.location.search);
|
||||
const curSkip = curParams.get('skip');
|
||||
if (curSkip) params.set('skip', curSkip);
|
||||
|
||||
// Next navigates to the next matching item (respecting skip)
|
||||
const qs = params.toString();
|
||||
window.location.href = qs ? (base + '?' + qs) : base;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user