From e201554dc6b3b480189961269a13a1daa1831894 Mon Sep 17 00:00:00 2001 From: KacperKoza343 Date: Wed, 26 Jun 2024 18:01:51 +0200 Subject: [PATCH] fix(app/worker/profile): refetch KVStore data after setting address --- .../pages/worker/profile/register-address-btn.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/apps/human-app/frontend/src/pages/worker/profile/register-address-btn.tsx b/packages/apps/human-app/frontend/src/pages/worker/profile/register-address-btn.tsx index d39fe981fe..d54a7048cf 100644 --- a/packages/apps/human-app/frontend/src/pages/worker/profile/register-address-btn.tsx +++ b/packages/apps/human-app/frontend/src/pages/worker/profile/register-address-btn.tsx @@ -2,19 +2,27 @@ import { t } from 'i18next'; import { Button } from '@/components/ui/button'; import { useRegisterAddress } from '@/api/servieces/worker/use-register-address'; import { useRegisterAddressNotifications } from '@/hooks/use-register-address-notifications'; +import { useGetOnChainRegisteredAddress } from '@/api/servieces/worker/get-on-chain-registered-address'; export function RegisterAddress({ disabled }: { disabled: boolean }) { const { onSuccess, onError } = useRegisterAddressNotifications(); + const { + refetch: refetchKVStoreAddressData, + isPending: isKVStoreAddressDataPending, + } = useGetOnChainRegisteredAddress(); const { mutate, isPending } = useRegisterAddress({ onError, - onSuccess, + onSuccess: () => { + void refetchKVStoreAddressData(); + onSuccess(); + }, }); return (