Page MenuHomePhabricator

D12023.id40145.diff
No OneTemporary

D12023.id40145.diff

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<Set<string>>(() => {
if (communitiesSuffixed.length === 1) {

File Metadata

Mime Type
text/plain
Expires
Fri, Dec 20, 8:45 AM (16 h, 58 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2681214
Default Alt Text
D12023.id40145.diff (1 KB)

Event Timeline