diff --git a/app/soapbox/entity-store/hooks/useDeleteEntity.ts b/app/soapbox/entity-store/hooks/useDeleteEntity.ts index 767224af60..dac1d9a267 100644 --- a/app/soapbox/entity-store/hooks/useDeleteEntity.ts +++ b/app/soapbox/entity-store/hooks/useDeleteEntity.ts @@ -15,7 +15,7 @@ function useDeleteEntity( ) { const dispatch = useAppDispatch(); const getState = useGetState(); - const [isLoading, setPromise] = useLoading(); + const [isSubmitting, setPromise] = useLoading(); async function deleteEntity(entityId: string, callbacks: EntityCallbacks = {}): Promise { // Get the entity before deleting, so we can reverse the action if the API request fails. @@ -47,7 +47,7 @@ function useDeleteEntity( return { deleteEntity, - isLoading, + isSubmitting, }; } diff --git a/app/soapbox/entity-store/hooks/useEntityActions.ts b/app/soapbox/entity-store/hooks/useEntityActions.ts index 13fda06acb..8b87c52fd5 100644 --- a/app/soapbox/entity-store/hooks/useEntityActions.ts +++ b/app/soapbox/entity-store/hooks/useEntityActions.ts @@ -24,16 +24,16 @@ function useEntityActions( const api = useApi(); const { entityType, path } = parseEntitiesPath(expandedPath); - const { deleteEntity, isLoading: deleteLoading } = + const { deleteEntity, isSubmitting: deleteSubmitting } = useDeleteEntity(entityType, (entityId) => api.delete(endpoints.delete!.replaceAll(':id', entityId))); - const { createEntity, isSubmitting: createLoading } = + const { createEntity, isSubmitting: createSubmitting } = useCreateEntity(path, (data) => api.post(endpoints.post!, data), opts); return { createEntity, deleteEntity, - isLoading: createLoading || deleteLoading, + isSubmitting: createSubmitting || deleteSubmitting, }; } diff --git a/app/soapbox/features/group/components/group-action-button.tsx b/app/soapbox/features/group/components/group-action-button.tsx index c697bc4ee6..ccf597900e 100644 --- a/app/soapbox/features/group/components/group-action-button.tsx +++ b/app/soapbox/features/group/components/group-action-button.tsx @@ -89,7 +89,7 @@ const GroupActionButton = ({ group }: IGroupActionButton) => { @@ -114,7 +114,7 @@ const GroupActionButton = ({ group }: IGroupActionButton) => { diff --git a/app/soapbox/hooks/api/groups/useCancelMembershipRequest.ts b/app/soapbox/hooks/api/groups/useCancelMembershipRequest.ts index 3aad33f9c5..3bb35ef43b 100644 --- a/app/soapbox/hooks/api/groups/useCancelMembershipRequest.ts +++ b/app/soapbox/hooks/api/groups/useCancelMembershipRequest.ts @@ -7,14 +7,14 @@ import type { Group, GroupRelationship } from 'soapbox/schemas'; function useCancelMembershipRequest(group: Group) { const me = useOwnAccount(); - const { createEntity, isLoading } = useEntityActions( + const { createEntity, isSubmitting } = useEntityActions( [Entities.GROUP_RELATIONSHIPS, group.id], { post: `/api/v1/groups/${group.id}/membership_requests/${me?.id}/reject` }, ); return { mutate: createEntity, - isLoading, + isSubmitting, }; } diff --git a/app/soapbox/hooks/api/groups/useDeleteGroup.ts b/app/soapbox/hooks/api/groups/useDeleteGroup.ts index 277cfec464..d1b25cccd2 100644 --- a/app/soapbox/hooks/api/groups/useDeleteGroup.ts +++ b/app/soapbox/hooks/api/groups/useDeleteGroup.ts @@ -4,14 +4,14 @@ import { useEntityActions } from 'soapbox/entity-store/hooks'; import type { Group } from 'soapbox/schemas'; function useDeleteGroup() { - const { deleteEntity, isLoading } = useEntityActions( + const { deleteEntity, isSubmitting } = useEntityActions( [Entities.GROUPS], { delete: '/api/v1/groups/:id' }, ); return { mutate: deleteEntity, - isLoading, + isSubmitting, }; } diff --git a/app/soapbox/hooks/api/groups/useJoinGroup.ts b/app/soapbox/hooks/api/groups/useJoinGroup.ts index 46cd1d5bd4..0ea9293d96 100644 --- a/app/soapbox/hooks/api/groups/useJoinGroup.ts +++ b/app/soapbox/hooks/api/groups/useJoinGroup.ts @@ -9,7 +9,7 @@ import type { Group, GroupRelationship } from 'soapbox/schemas'; function useJoinGroup(group: Group) { const { invalidate } = useGroups(); - const { createEntity, isLoading } = useEntityActions( + const { createEntity, isSubmitting } = useEntityActions( [Entities.GROUP_RELATIONSHIPS, group.id], { post: `/api/v1/groups/${group.id}/join` }, { schema: groupRelationshipSchema }, @@ -17,7 +17,7 @@ function useJoinGroup(group: Group) { return { mutate: createEntity, - isLoading, + isSubmitting, invalidate, }; } diff --git a/app/soapbox/hooks/api/groups/useLeaveGroup.ts b/app/soapbox/hooks/api/groups/useLeaveGroup.ts index af78c6d359..e1b11e7372 100644 --- a/app/soapbox/hooks/api/groups/useLeaveGroup.ts +++ b/app/soapbox/hooks/api/groups/useLeaveGroup.ts @@ -9,7 +9,7 @@ import type { Group, GroupRelationship } from 'soapbox/schemas'; function useLeaveGroup(group: Group) { const { invalidate } = useGroups(); - const { createEntity, isLoading } = useEntityActions( + const { createEntity, isSubmitting } = useEntityActions( [Entities.GROUP_RELATIONSHIPS, group.id], { post: `/api/v1/groups/${group.id}/leave` }, { schema: groupRelationshipSchema }, @@ -17,7 +17,7 @@ function useLeaveGroup(group: Group) { return { mutate: createEntity, - isLoading, + isSubmitting, invalidate, }; }