@broxus/evm-connect 1.12.5 → 1.12.6

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.
@@ -39,6 +39,7 @@ exports.useRecentConnectionMeta = useRecentConnectionMeta;
39
39
  const js_utils_1 = require("@broxus/js-utils");
40
40
  const React = __importStar(require("react"));
41
41
  const constants_1 = require("../constants");
42
+ const context_1 = require("../context");
42
43
  const types_1 = require("../types");
43
44
  function isRecentConnectionMeta(value) {
44
45
  const meta = { providerId: value.providerId, type: value.type };
@@ -70,7 +71,8 @@ function getRecentConnectionMeta(storageKey = constants_1.EVM_RECENT_CONNECTION)
70
71
  return undefined;
71
72
  }
72
73
  function useRecentConnectionMeta(storageKey = constants_1.EVM_RECENT_CONNECTION) {
73
- const [meta, setMeta] = React.useState(getRecentConnectionMeta(storageKey));
74
+ const walletProviders = (0, context_1.useEvmWalletProviders)();
75
+ const [meta, setMeta] = React.useState(getRecentConnectionMeta(walletProviders.recentMetaStorageKey || storageKey));
74
76
  React.useEffect(() => {
75
77
  const onStorage = (event) => {
76
78
  if (event.key === storageKey && event.newValue) {
@@ -1,6 +1,7 @@
1
1
  import { debug, isBrowser, storage } from '@broxus/js-utils';
2
2
  import * as React from 'react';
3
3
  import { EVM_RECENT_CONNECTION } from '../constants';
4
+ import { useEvmWalletProviders } from '../context';
4
5
  import { EthereumConnectionType } from '../types';
5
6
  function isRecentConnectionMeta(value) {
6
7
  const meta = { providerId: value.providerId, type: value.type };
@@ -32,7 +33,8 @@ export function getRecentConnectionMeta(storageKey = EVM_RECENT_CONNECTION) {
32
33
  return undefined;
33
34
  }
34
35
  export function useRecentConnectionMeta(storageKey = EVM_RECENT_CONNECTION) {
35
- const [meta, setMeta] = React.useState(getRecentConnectionMeta(storageKey));
36
+ const walletProviders = useEvmWalletProviders();
37
+ const [meta, setMeta] = React.useState(getRecentConnectionMeta(walletProviders.recentMetaStorageKey || storageKey));
36
38
  React.useEffect(() => {
37
39
  const onStorage = (event) => {
38
40
  if (event.key === storageKey && event.newValue) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@broxus/evm-connect",
3
- "version": "1.12.5",
3
+ "version": "1.12.6",
4
4
  "description": "Ethereum wallets connector.",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -96,5 +96,5 @@
96
96
  "web3-types": "^1.x",
97
97
  "web3-utils": "^4.x"
98
98
  },
99
- "gitHead": "7ac22e228c35e0140f251e2103fa6d4af1ff8679"
99
+ "gitHead": "1f2acedddb3842763108c15d003adea77bf8787a"
100
100
  }