diff --git a/native/navigation/community-drawer-content.react.js b/native/navigation/community-drawer-content.react.js --- a/native/navigation/community-drawer-content.react.js +++ b/native/navigation/community-drawer-content.react.js @@ -7,6 +7,10 @@ import { SafeAreaView } from 'react-native-safe-area-context'; import { useSelector } from 'react-redux'; +import { + fetchCommunityInfosActionTypes, + useFetchCommunityInfos, +} from 'lib/actions/community-actions.js'; import { fetchPrimaryInviteLinkActionTypes, useFetchPrimaryInviteLinks, @@ -47,17 +51,35 @@ const styles = useStyles(unboundStyles); const callFetchPrimaryLinks = useFetchPrimaryInviteLinks(); + const fetchCommunityInfos = useFetchCommunityInfos(); + const dispatchActionPromise = useDispatchActionPromise(); const drawerStatus = useDrawerStatus(); React.useEffect(() => { if (drawerStatus !== 'open') { return; } - void dispatchActionPromise( + const fetchPrimaryInviteLinkPromise = dispatchActionPromise( fetchPrimaryInviteLinkActionTypes, callFetchPrimaryLinks(), ); - }, [callFetchPrimaryLinks, dispatchActionPromise, drawerStatus]); + const fetchCommunityInfosPromise = dispatchActionPromise( + fetchCommunityInfosActionTypes, + fetchCommunityInfos(), + ); + + void (async () => { + await Promise.all([ + fetchPrimaryInviteLinkPromise, + fetchCommunityInfosPromise, + ]); + })(); + }, [ + callFetchPrimaryLinks, + dispatchActionPromise, + drawerStatus, + fetchCommunityInfos, + ]); const [expanded, setExpanded] = React.useState>(() => { if (communitiesSuffixed.length === 1) {