Skip to content

Commit

Permalink
Fix ContextProviders default value
Browse files Browse the repository at this point in the history
  • Loading branch information
lubej committed Apr 19, 2024
1 parent 08196a0 commit f2aa2ae
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/hooks/useEIP1193.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { EIP1193Context } from '../providers/EIP1193Context'

export const useEIP1193 = () => {
const value = useContext(EIP1193Context)
if (value === undefined) {
if (Object.keys(value).length === 0) {
throw new Error('[useEIP1193] Component not wrapped within a Provider')
}

Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useEIP6963.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { EIP6963Context } from '../providers/EIP6963Context.ts'

export const useEIP6963 = () => {
const value = useContext(EIP6963Context)
if (value === undefined) {
if (Object.keys(value).length === 0) {
throw new Error('[useEIP6963] Component not wrapped within a Provider')
}

Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useEIP6963Manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { EIP6963ManagerContext } from '../providers/EIP6963ManagerContext.ts'

export const useEIP6963Manager = () => {
const value = useContext(EIP6963ManagerContext)
if (value === undefined) {
if (Object.keys(value).length === 0) {
throw new Error('[useEIP6963Manager] Component not wrapped within a Provider')
}

Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useWeb3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Web3Context } from '../providers/Web3Context'

export const useWeb3 = () => {
const value = useContext(Web3Context)
if (value === undefined) {
if (Object.keys(value).length === 0) {
throw new Error('[useWeb3] Component not wrapped within a Provider')
}

Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useWrapForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { WrapFormContext } from '../providers/WrapFormContext'

export const useWrapForm = () => {
const value = useContext(WrapFormContext)
if (value === undefined) {
if (Object.keys(value).length === 0) {
throw new Error('[useWrapForm] Component not wrapped within a Provider')
}

Expand Down

0 comments on commit f2aa2ae

Please sign in to comment.