Skip to content

Commit

Permalink
Fix bug where a connected wallet might not update providerMut (#222)
Browse files Browse the repository at this point in the history
  • Loading branch information
macalinao committed Aug 31, 2021
1 parent 03d29ea commit 7c5b85a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/use-solana/src/utils/useProviderInternal.ts
Expand Up @@ -62,9 +62,12 @@ export const useProviderInternal = ({
),
[commitment, connection, sendConnection]
);

const connected = wallet?.connected;
const publicKey = wallet?.publicKey;
const providerMut = useMemo(
() =>
wallet && wallet.publicKey
wallet && connected && publicKey
? new SolanaProvider(
connection,
sendConnection,
Expand All @@ -74,7 +77,7 @@ export const useProviderInternal = ({
}
)
: null,
[commitmentMut, connection, sendConnection, wallet]
[wallet, connected, publicKey, connection, sendConnection, commitmentMut]
);

return {
Expand Down

1 comment on commit 7c5b85a

@vercel
Copy link

@vercel vercel bot commented on 7c5b85a Aug 31, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.