fix: fetch discussion and ressources info when accepting a group invitation
Also ensure that the actor is included in PERSON_STATUS_GROUP, to stay consistent with LOGGED_USER_MEMBERSHIPS as used in MyGroups.vue. The accept-invitation and refuse-invitation events needed to be emitted before refetching PERSON_STATUS_GROUP, so they can be caught by GroupView.vue before <InvitationsList> is destroyed due to the v-if becoming false. Fixes #1800
This commit is contained in:
@@ -327,6 +327,8 @@
|
||||
isCurrentActorAnInvitedGroupMember && groupMember !== undefined
|
||||
"
|
||||
:invitations="[groupMember]"
|
||||
@accept-invitation="refetchGroupInformations"
|
||||
@reject-invitation="refetchGroupInformations"
|
||||
/>
|
||||
<o-notification
|
||||
class="my-2"
|
||||
@@ -688,19 +690,23 @@ const {
|
||||
} = useGroup(preferredUsername, { afterDateTime: new Date() });
|
||||
const router = useRouter();
|
||||
|
||||
const { group: discussionGroup } = useGroupDiscussionsList(preferredUsername);
|
||||
const { group: resourcesGroup } = useGroupResourcesList(preferredUsername, {
|
||||
resourcesPage: 1,
|
||||
resourcesLimit: 3,
|
||||
});
|
||||
const { group: discussionGroup, refetch: refetchGroupDiscussionsList } =
|
||||
useGroupDiscussionsList(preferredUsername);
|
||||
const { group: resourcesGroup, refetch: refetchGroupResourcesList } =
|
||||
useGroupResourcesList(preferredUsername, {
|
||||
resourcesPage: 1,
|
||||
resourcesLimit: 3,
|
||||
});
|
||||
|
||||
const { t } = useI18n({ useScope: "global" });
|
||||
|
||||
const { isLongEvents } = useIsLongEvents();
|
||||
|
||||
// const { person } = usePersonStatusGroup(group);
|
||||
|
||||
const { result, subscribeToMore } = useQuery<{
|
||||
const {
|
||||
result,
|
||||
subscribeToMore,
|
||||
refetch: refetchPersonStatusGroup,
|
||||
} = useQuery<{
|
||||
person: IPerson;
|
||||
}>(
|
||||
PERSON_STATUS_GROUP,
|
||||
@@ -755,6 +761,12 @@ watch(
|
||||
}
|
||||
);
|
||||
|
||||
const refetchGroupInformations = () => {
|
||||
refetchPersonStatusGroup();
|
||||
refetchGroupResourcesList();
|
||||
refetchGroupDiscussionsList();
|
||||
};
|
||||
|
||||
const { mutate: joinGroupMutation, onError: onJoinGroupError } =
|
||||
useMutation(JOIN_GROUP);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user