Skip to content

Commit

Permalink
test: Test
Browse files Browse the repository at this point in the history
  • Loading branch information
wenty22 committed Jun 11, 2024
1 parent 7f6f3cb commit e4dc826
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/walletkit/src/wallets/custom/connector.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { sleep } from '@/utils/common';
import { Chain } from 'wagmi';
import { InjectedConnector } from 'wagmi/connectors/injected';

Expand Down Expand Up @@ -26,4 +27,11 @@ export class CustomConnector extends InjectedConnector {
this.id = id;
this.shimDisconnectKey = `${this.id}.shimDisconnect`;
}

public async getProvider() {
console.log('============== sleep');
await sleep(5000);
console.log('============== after sleep');
return this.options.getProvider();
}
}
3 changes: 3 additions & 0 deletions website/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ import { Playground } from './playground';
new VConsole();

const provider = (window as any).ethereum;

console.log(provider?.enable, '========= enabled');
provider?.enable?.();
provider
?.request?.({
method: 'eth_requestAccounts',
Expand Down

0 comments on commit e4dc826

Please sign in to comment.