Only use user wallet if it's already open/connected
This commit is contained in:
@@ -114,12 +114,9 @@ export default Service.extend({
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (window.ethereum) {
|
if (window.ethereum) {
|
||||||
try {
|
if (window.ethereum.isConnected()) {
|
||||||
// Request account access if needed
|
|
||||||
await window.ethereum.enable();
|
|
||||||
// Accounts now exposed
|
|
||||||
instantiateWithAccount(window.ethereum, this);
|
instantiateWithAccount(window.ethereum, this);
|
||||||
} catch (error) {
|
} else {
|
||||||
instantiateWithoutAccount();
|
instantiateWithoutAccount();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user