diff --git a/contexts/AddressesContext.tsx b/contexts/AddressesContext.tsx index e3145df96aa3f13e7511e33e74d31f8e093f2733..029a825a2cf2fa110af3fcd50b7c6d770bb75323 100644 --- a/contexts/AddressesContext.tsx +++ b/contexts/AddressesContext.tsx @@ -19,7 +19,7 @@ export const useAddressesContext = () => { const context = useContext(AddressesContext); if (context === undefined) { - throw new Error("hook must be used inside it`s context"); + throw new Error("useAddressesContext must be used inside it`s context"); } return context; diff --git a/contexts/HeadBlockContext.tsx b/contexts/HeadBlockContext.tsx index d9bd16606c2bd4d8764e1ab65aeb1cb262fccc8e..54b7b44889b35c2d425b93464f20369f2e7537f7 100644 --- a/contexts/HeadBlockContext.tsx +++ b/contexts/HeadBlockContext.tsx @@ -20,7 +20,7 @@ export const HeadBlockContext = createContext<IHeadBlockContext | undefined>( export const useHeadBlockNumber = () => { const context = useContext(HeadBlockContext); if (context === undefined) { - throw new Error("hook must be used inside it`s context"); + throw new Error("useHeadBlockNumber must be used inside it`s context"); } return context; diff --git a/contexts/HiveChainContext.tsx b/contexts/HiveChainContext.tsx index 64acf7096d64f2c8fe831a89a82c501fa0a6eb23..161c32da3b00804ac7973d474644cb67418cf44d 100644 --- a/contexts/HiveChainContext.tsx +++ b/contexts/HiveChainContext.tsx @@ -14,7 +14,7 @@ export const useHiveChainContext = () => { const context = useContext(HiveChainContext); if (context === undefined) { - throw new Error("hook must be used inside it`s context"); + throw new Error("useHiveChainContext must be used inside it`s context"); } return context; diff --git a/contexts/OperationsTypesContext.tsx b/contexts/OperationsTypesContext.tsx index 9169cb1d4736e49d26a668567f070ac09aebedd5..60730568f250429f2bdd8e49f2f59b5dd8706536 100644 --- a/contexts/OperationsTypesContext.tsx +++ b/contexts/OperationsTypesContext.tsx @@ -11,7 +11,17 @@ export const OperationTypesContext = createContext<OperationTypesContextType>({ operationsTypes: undefined, }); -export const useOperationTypesContext = () => useContext(OperationTypesContext); +export const useOperationTypesContext = () => { + const context = useContext(OperationTypesContext); + + if (context === undefined) { + throw new Error( + "useOperationTypesContext must be used inside it`s context" + ); + } + + return context; +}; export const OperationTypesContextProvider: React.FC<{ children: React.ReactNode; diff --git a/contexts/UserSettingsContext.tsx b/contexts/UserSettingsContext.tsx index 2809f89e5fda8ef088fd1269a695012d676784f0..0a990887f10db465aecdac6e512a060e89286635 100644 --- a/contexts/UserSettingsContext.tsx +++ b/contexts/UserSettingsContext.tsx @@ -20,7 +20,7 @@ export const useUserSettingsContext = () => { const context = useContext(UserSettingsContext); if (context === undefined) { - throw new Error("hook must be used inside it`s context"); + throw new Error("useUserSettingsContext must be used inside it`s context"); } return context;