react-web3-storage 1.0.4 → 1.0.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-web3-storage",
3
- "version": "1.0.4",
3
+ "version": "1.0.41",
4
4
  "description": "Simple web3 storage for react dapp",
5
5
  "main": "src/index.js",
6
6
  "author": "Stas Prohetamine",
package/src/provider.js CHANGED
@@ -1,18 +1,19 @@
1
- import React from 'react';
2
1
  import { createAppKit, AppKitProvider } from '@reown/appkit/react'
3
2
  import { EthersAdapter } from '@reown/appkit-adapter-ethers'
4
3
 
5
- import config from '../config.js'
4
+ import _config from '../config.js'
6
5
 
6
+ const Provider = ({ children, config }) => {
7
+ if (!window.REACT_WEB3_createdAppKit) {
8
+ window.REACT_WEB3_createdAppKit = true
7
9
  createAppKit({
8
10
  projectId: config.projectId,
9
11
  adapters: [new EthersAdapter()],
10
- networks: config.networks,
12
+ networks: _config.networks,
11
13
  metadata: config.metadata
12
14
  })
13
-
15
+ }
14
16
 
15
- const Provider = ({ children, config }) => {
16
17
  return AppKitProvider({ children, ...config })
17
18
  }
18
19
 
package/src/use-app.js CHANGED
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  import { useAppKit, useAppKitAccount } from '@reown/appkit/react'
3
2
 
4
3
  const useApp = () => {
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  import { useAppKit, useAppKitAccount, useAppKitProvider } from '@reown/appkit/react'
3
2
  import { BrowserProvider, Contract } from 'ethers'
4
3
  import config from '../config.js'
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  import { useAppKit, useAppKitAccount, useAppKitProvider } from '@reown/appkit/react'
3
2
  import { BrowserProvider, Contract, Wallet, JsonRpcProvider } from 'ethers'
4
3
  import config from '../config.js'
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  import { useAppKit, useAppKitAccount, useAppKitProvider } from '@reown/appkit/react'
3
2
  import { BrowserProvider, Contract } from 'ethers'
4
3
  import config from '../config.js'
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  import { useAppKit, useAppKitAccount, useAppKitProvider } from '@reown/appkit/react'
3
2
  import { BrowserProvider, Contract, Wallet, JsonRpcProvider } from 'ethers'
4
3
  import config from '../config.js'