From 5b7f3f64613f7f569fa51a45996881255c1ebd71 Mon Sep 17 00:00:00 2001 From: Wenty Li <105278450+wenty22@users.noreply.github.com> Date: Mon, 29 Jul 2024 10:34:40 +0800 Subject: [PATCH] fix: ssr no need to wait for the provider to be ready (#173) * feat: Upgrade wagmi * refactor: Optimize code * feat: Update examples * feat: Add customized life cycle for `injected` * feat: Update docs * docs: Add changelog * chore: update versions (alpha) (#162) Co-authored-by: github-actions[bot] * Merge branch 'main' into dev * feat: Update README.md * fix: ssr no need to wait for the provider to be ready * fix: ssr no need to wait for the provider to be ready (#165) * Merge branch 'main' into dev * feat: Update README.md * fix: ssr no need to wait for the provider to be ready * chore: update versions (alpha) (#166) Co-authored-by: github-actions[bot] * test: Add log * chore: update versions (alpha) (#170) Co-authored-by: github-actions[bot] --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] --- .changeset/nervous-penguins-confess.md | 5 +++++ .changeset/pre.json | 14 ++++++++++++++ .changeset/quick-squids-rush.md | 5 +++++ packages/walletkit/CHANGELOG.md | 7 +++++++ packages/walletkit/package.json | 2 +- .../walletkit/src/modals/ConnectModal/provider.tsx | 8 ++++++++ 6 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 .changeset/nervous-penguins-confess.md create mode 100644 .changeset/pre.json create mode 100644 .changeset/quick-squids-rush.md diff --git a/.changeset/nervous-penguins-confess.md b/.changeset/nervous-penguins-confess.md new file mode 100644 index 00000000..8ebac006 --- /dev/null +++ b/.changeset/nervous-penguins-confess.md @@ -0,0 +1,5 @@ +--- +'@node-real/walletkit': patch +--- + +test: Add log diff --git a/.changeset/pre.json b/.changeset/pre.json new file mode 100644 index 00000000..170d033a --- /dev/null +++ b/.changeset/pre.json @@ -0,0 +1,14 @@ +{ + "mode": "pre", + "tag": "alpha", + "initialVersions": { + "example-nextjs": "0.0.1", + "example-vite": "0.0.1", + "@node-real/walletkit": "2.0.2", + "website": "0.0.1" + }, + "changesets": [ + "nervous-penguins-confess", + "quick-squids-rush" + ] +} diff --git a/.changeset/quick-squids-rush.md b/.changeset/quick-squids-rush.md new file mode 100644 index 00000000..b6c0718a --- /dev/null +++ b/.changeset/quick-squids-rush.md @@ -0,0 +1,5 @@ +--- +'@node-real/walletkit': patch +--- + +fix: ssr no need to wait for the provider to be ready diff --git a/packages/walletkit/CHANGELOG.md b/packages/walletkit/CHANGELOG.md index b6cf0d70..1cde0782 100644 --- a/packages/walletkit/CHANGELOG.md +++ b/packages/walletkit/CHANGELOG.md @@ -1,5 +1,12 @@ # @node-real/walletkit +## 2.0.3-alpha.0 + +### Patch Changes + +- d5437a7: test: Add log +- 90846a4: fix: ssr no need to wait for the provider to be ready + ## 2.0.2 ### Patch Changes diff --git a/packages/walletkit/package.json b/packages/walletkit/package.json index 515b7c71..528f8524 100644 --- a/packages/walletkit/package.json +++ b/packages/walletkit/package.json @@ -1,6 +1,6 @@ { "name": "@node-real/walletkit", - "version": "2.0.2", + "version": "2.0.3-alpha.0", "author": "node-real", "private": false, "description": "WalletKit is a React component library for easily connecting a wallet to your dApp.", diff --git a/packages/walletkit/src/modals/ConnectModal/provider.tsx b/packages/walletkit/src/modals/ConnectModal/provider.tsx index 87f4b9f4..1712ef4b 100644 --- a/packages/walletkit/src/modals/ConnectModal/provider.tsx +++ b/packages/walletkit/src/modals/ConnectModal/provider.tsx @@ -44,7 +44,15 @@ function WithRouter(props: ConnectModalProviderProps) { }, [isOpen, onClose, onOpen, router, setAction]); useEffect(() => { + console.log( + 'route: ', + router.route, + router.route !== routes.CONNECTORS, + isConnected, + options.closeModalAfterConnected, + ); if (router.route !== routes.CONNECTORS && isConnected && options.closeModalAfterConnected) { + console.log('onClose: ', value?.onClose); value?.onClose(); } // eslint-disable-next-line react-hooks/exhaustive-deps