diff --git a/native/chat/settings/thread-settings.react.js b/native/chat/settings/thread-settings.react.js --- a/native/chat/settings/thread-settings.react.js +++ b/native/chat/settings/thread-settings.react.js @@ -12,6 +12,10 @@ import { createSelector } from 'reselect'; import tinycolor from 'tinycolor2'; +import { + fetchPrimaryInviteLinkActionTypes, + useFetchPrimaryInviteLinks, +} from 'lib/actions/link-actions.js'; import { changeThreadMemberRolesActionTypes, changeThreadSettingsActionTypes, @@ -51,6 +55,7 @@ useResolvedOptionalThreadInfos, useResolvedThreadInfo, } from 'lib/utils/entity-helpers.js'; +import { useDispatchActionPromise } from 'lib/utils/redux-promise-utils.js'; import ThreadSettingsAvatar from './thread-settings-avatar.react.js'; import type { CategoryType } from './thread-settings-category.react.js'; @@ -1331,6 +1336,18 @@ const canAddMembers = canAddMembersManually || canAddMembersViaInviteLink; + const callFetchPrimaryLinks = useFetchPrimaryInviteLinks(); + const dispatchActionPromise = useDispatchActionPromise(); + React.useEffect(() => { + if (!isCommunityRoot) { + return; + } + void dispatchActionPromise( + fetchPrimaryInviteLinkActionTypes, + callFetchPrimaryLinks(), + ); + }, [callFetchPrimaryLinks, dispatchActionPromise, isCommunityRoot]); + return (