Skip to content

Commit

Permalink
UI: Small change to new-post-page's select-community
Browse files Browse the repository at this point in the history
Show the top communities first in the input box suggestions.
  • Loading branch information
previnder committed Nov 5, 2024
1 parent ba709e5 commit 21089da
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ui/src/pages/NewPost/SelectCommunity.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const SelectCommunity = ({ initial = '', onFocus, onChange, disabled = false })
useEffect(() => {
(async function () {
try {
const communities = await mfetchjson('/api/communities?limit=10');
const communities = await mfetchjson('/api/communities?sort=size&limit=10');
setSuggestions(communities);
} catch (error) {
dispatch(snackAlertError(error));
Expand Down Expand Up @@ -41,7 +41,7 @@ const SelectCommunity = ({ initial = '', onFocus, onChange, disabled = false })
useCallback(() => {
(async function () {
try {
const communities = await mfetchjson(`/api/communities?q=${value}&limit=10`);
const communities = await mfetchjson(`/api/communities?q=${value}&sort=size&limit=10`);
setSuggestions(communities);
} catch (error) {
console.error(error);
Expand Down

0 comments on commit 21089da

Please sign in to comment.