fix communities fetch

This commit is contained in:
feruz 2021-03-03 08:37:06 +02:00
parent 7ebe8c64a5
commit 70d864190d
3 changed files with 3 additions and 3 deletions

View File

@ -295,7 +295,7 @@ export const getCommunityTitle = async (tag) =>
export const getCommunities = async (
last = '',
limit = 100,
query = '',
query = null,
sort = 'rank',
observer = '',
) =>

View File

@ -30,7 +30,7 @@ const CommunitiesContainer = ({ children, navigation }) => {
useEffect(() => {
getSubscriptions(currentAccount.username).then((subs) => {
subs.forEach((item) => item.push(true));
getCommunities('', 50, '', 'rank').then((communities) => {
getCommunities('', 50, null, 'rank').then((communities) => {
communities.forEach((community) =>
Object.assign(community, {
isSubscribed: subs.some(

View File

@ -45,7 +45,7 @@ const CommunitiesResultsContainer = ({ children, navigation, searchValue }) => {
setData([]);
setNoResult(false);
getCommunities('', searchValue ? 100 : 20, searchValue, 'rank')
getCommunities('', searchValue ? 100 : 20, searchValue || null, 'rank')
.then((communities) => {
if (currentAccount && currentAccount.username) {
getSubscriptions(currentAccount.username).then((subs) => {