From b4c3248791f2521c7ef4c782e2357a5f2c0d8948 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 23 Mar 2023 15:09:00 -0500 Subject: [PATCH] useEntityActions: fix isLoading --- app/soapbox/entity-store/hooks/useEntityActions.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/soapbox/entity-store/hooks/useEntityActions.ts b/app/soapbox/entity-store/hooks/useEntityActions.ts index 63ede41d5..fa90765b0 100644 --- a/app/soapbox/entity-store/hooks/useEntityActions.ts +++ b/app/soapbox/entity-store/hooks/useEntityActions.ts @@ -28,11 +28,13 @@ function useEntityActions( const create = useCreateEntity(path, { method: 'post', url: endpoints.post }, opts); const createEntity: typeof create = async (...args) => { + setIsLoading(true); await create(...args); setIsLoading(false); }; const deleteEntity: typeof _delete = async (...args) => { + setIsLoading(true); await _delete(...args); setIsLoading(false); };