Skip to content

Commit a97a93b

Browse files
authored
Merge pull request #1591 from elimu-ai/1585_Fix_broken_logout_functionality_
1585 Fix broken logout functionality
2 parents 4c56166 + e9f0a1c commit a97a93b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main/webapp/static/js/web3provider.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ async function disconnect() {
8585
console.log("Killing the wallet connection", provider);
8686

8787
// TODO: Which providers have close method?
88-
if (provider.close) {
88+
if (provider && provider.close) {
8989
await provider.close();
9090

9191
// If the cached provider is not cleared,
@@ -94,7 +94,9 @@ async function disconnect() {
9494
// Depending on your use case you may want or want not his behavir.
9595
provider = null;
9696
}
97-
await web3Modal.clearCachedProvider();
97+
if (web3Modal) {
98+
await web3Modal.clearCachedProvider();
99+
}
98100
}
99101

100102
/**

0 commit comments

Comments
 (0)