From 2c59933cd028ea045f9a5211b8be1d7f2eacde5f Mon Sep 17 00:00:00 2001 From: Chewbacca Date: Thu, 11 May 2023 15:00:28 -0400 Subject: [PATCH] Handle API errors when failing to join group --- .../features/group/components/group-action-button.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/soapbox/features/group/components/group-action-button.tsx b/app/soapbox/features/group/components/group-action-button.tsx index 005b9e245..f3b208574 100644 --- a/app/soapbox/features/group/components/group-action-button.tsx +++ b/app/soapbox/features/group/components/group-action-button.tsx @@ -55,6 +55,12 @@ const GroupActionButton = ({ group }: IGroupActionButton) => { : intl.formatMessage(messages.joinSuccess), ); }, + onError(error) { + const message = (error.response?.data as any).error; + if (message) { + toast.error(message); + } + }, }); const onLeaveGroup = () =>