Skip to content
Snippets Groups Projects
Commit f866591d authored by Lukas's avatar Lukas
Browse files

Update other contexts error messages

parent 4cbd6a63
No related branches found
No related tags found
1 merge request!494Lbudginas/#392 part1 reduce searches component
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment