From 19de46e718f1cf5b71e71ea1b0f5c58be277d940 Mon Sep 17 00:00:00 2001 From: Sharun Date: Sun, 27 Aug 2023 13:18:36 -0400 Subject: [PATCH] callback passed to blockUser --- src/features/user/useUserDetails.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/features/user/useUserDetails.tsx b/src/features/user/useUserDetails.tsx index 259a364e26..7bb83cd2b8 100644 --- a/src/features/user/useUserDetails.tsx +++ b/src/features/user/useUserDetails.tsx @@ -32,7 +32,11 @@ export function useUserDetails(handle: string) { throw error; } - present(buildBlocked(!isBlocked, handle)); + present( + buildBlocked(!isBlocked, handle, () => { + dispatch(blockUser(isBlocked!, user.id)); + }), + ); } return { isBlocked, user, blockOrUnblock };