Disable search results pagination if not authenticated

pull/272/head 2023.10.26.87f1d17
Lim Chee Aun 2023-10-26 17:39:10 +08:00
rodzic 2310664065
commit 35dced8eaf
1 zmienionych plików z 6 dodań i 0 usunięć

Wyświetl plik

@ -71,6 +71,11 @@ function Search(props) {
};
function loadResults(firstLoad) {
if (!firstLoad && !authenticated) {
// Search results pagination is only available to authenticated users
return;
}
setUIState('loading');
if (firstLoad && !type) {
setStatusResults(statusResults.slice(0, SHORT_LIMIT));
@ -89,6 +94,7 @@ function Search(props) {
params.type = type;
if (authenticated) params.offset = offsetRef.current;
}
try {
const results = await masto.v2.search.fetch(params);
console.log(results);