diff --git a/src/components/search/SearchCTA.jsx b/src/components/search/SearchCTA.jsx
index 307d213..948f613 100644
--- a/src/components/search/SearchCTA.jsx
+++ b/src/components/search/SearchCTA.jsx
@@ -16,7 +16,7 @@ export const SearchCTA = ({ details }) => {
const url = `https://hns.id/domain/${details.label}.${TLD}`;
return (
diff --git a/src/constants.js b/src/constants.js
index 9bf2837..832e222 100644
--- a/src/constants.js
+++ b/src/constants.js
@@ -3,9 +3,9 @@ export const DEV_MODE = location.hostname === 'localhost';
export const TLD = 'wallet';
-export const HERO_TEXT = 'Own your .wallet';
+export const HERO_TEXT = 'Own your .' + TLD;
export const SUB_TEXT = 'Decentralized domains for websites, wallets and web3';
-export const SEARCH_PLACEHOLDER = 'Find your .wallet';
+export const SEARCH_PLACEHOLDER = 'Find your .' + TLD;
export const PAGE_TITLE = HERO_TEXT;
export const TWITTER_HANDLE = 'walletdomain';
diff --git a/src/hooks/useRegister.js b/src/hooks/useRegister.js
index d21af68..5d0eb4a 100644
--- a/src/hooks/useRegister.js
+++ b/src/hooks/useRegister.js
@@ -46,7 +46,7 @@ export const useRegister = ({
enabled: isConnected,
});
- const { data } = useSimulateContract({
+ const { data, failureReason } = useSimulateContract({
abi,
address: REGISTER_CONTRACT_ADDR,
functionName: 'registerWithSignature',
@@ -65,5 +65,11 @@ export const useRegister = ({
});
const { writeContractAsync } = useWriteContract();
- return () => writeContractAsync(data?.request);
+ return () => {
+ if (failureReason && !data?.request) {
+ return Promise.reject(failureReason);
+ }
+
+ return writeContractAsync(data?.request);
+ };
};