mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-03-21 13:19:22 +01:00
Disable search results pagination if not authenticated
This commit is contained in:
parent
2310664065
commit
35dced8eaf
1 changed files with 6 additions and 0 deletions
|
@ -71,6 +71,11 @@ function Search(props) {
|
||||||
};
|
};
|
||||||
|
|
||||||
function loadResults(firstLoad) {
|
function loadResults(firstLoad) {
|
||||||
|
if (!firstLoad && !authenticated) {
|
||||||
|
// Search results pagination is only available to authenticated users
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
setUIState('loading');
|
setUIState('loading');
|
||||||
if (firstLoad && !type) {
|
if (firstLoad && !type) {
|
||||||
setStatusResults(statusResults.slice(0, SHORT_LIMIT));
|
setStatusResults(statusResults.slice(0, SHORT_LIMIT));
|
||||||
|
@ -89,6 +94,7 @@ function Search(props) {
|
||||||
params.type = type;
|
params.type = type;
|
||||||
if (authenticated) params.offset = offsetRef.current;
|
if (authenticated) params.offset = offsetRef.current;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const results = await masto.v2.search.fetch(params);
|
const results = await masto.v2.search.fetch(params);
|
||||||
console.log(results);
|
console.log(results);
|
||||||
|
|
Loading…
Reference in a new issue