From cfaa3ea6698cee09912cc4b2a6b67d9a78940bad Mon Sep 17 00:00:00 2001 From: Chewbacca Date: Fri, 12 May 2023 12:50:32 -0400 Subject: [PATCH] Invalidate group tags after updating Group --- app/soapbox/features/group/edit-group.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/soapbox/features/group/edit-group.tsx b/app/soapbox/features/group/edit-group.tsx index c0e972604d..82f4841b40 100644 --- a/app/soapbox/features/group/edit-group.tsx +++ b/app/soapbox/features/group/edit-group.tsx @@ -1,7 +1,7 @@ import React, { useEffect, useState } from 'react'; import { defineMessages, FormattedMessage, useIntl } from 'react-intl'; -import { useGroup, useUpdateGroup } from 'soapbox/api/hooks'; +import { useGroup, useGroupTags, useUpdateGroup } from 'soapbox/api/hooks'; import { Button, Column, Form, FormActions, FormGroup, Icon, Input, Spinner, Textarea } from 'soapbox/components/ui'; import { useAppSelector, useInstance } from 'soapbox/hooks'; import { useImageField, useTextField } from 'soapbox/hooks/forms'; @@ -36,6 +36,7 @@ const EditGroup: React.FC = ({ params: { groupId } }) => { const { group, isLoading } = useGroup(groupId); const { updateGroup } = useUpdateGroup(groupId); + const { invalidate } = useGroupTags(groupId); const [isSubmitting, setIsSubmitting] = useState(false); const [tags, setTags] = useState(['']); @@ -64,6 +65,7 @@ const EditGroup: React.FC = ({ params: { groupId } }) => { tags, }, { onSuccess() { + invalidate(); toast.success(intl.formatMessage(messages.groupSaved)); }, onError(error) {