Skip to content

Commit

Permalink
Disable search results pagination if not authenticated
Browse files Browse the repository at this point in the history
  • Loading branch information
cheeaun committed Oct 26, 2023
1 parent 2310664 commit 35dced8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/pages/search.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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);
Expand Down

0 comments on commit 35dced8

Please sign in to comment.