fix(trading,governance): eager connection for browser wallet (#4444)
This commit is contained in:
parent
b87c981a90
commit
65071f57d0
@ -31,7 +31,14 @@ export function useEagerConnect(Connectors: {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
await connect(Connectors[cfg.connector]);
|
if (cfg.connector === 'injected') {
|
||||||
|
const injectedInstance = Connectors[cfg.connector];
|
||||||
|
// @ts-ignore only injected wallet has connectWallet method
|
||||||
|
await injectedInstance.connectWallet();
|
||||||
|
await connect(injectedInstance);
|
||||||
|
} else {
|
||||||
|
await connect(Connectors[cfg.connector]);
|
||||||
|
}
|
||||||
} catch {
|
} catch {
|
||||||
console.warn(`Failed to connect with connector: ${cfg.connector}`);
|
console.warn(`Failed to connect with connector: ${cfg.connector}`);
|
||||||
} finally {
|
} finally {
|
||||||
|
Loading…
Reference in New Issue
Block a user