Skip to content

Commit

Permalink
Fixing merge issues
Browse files Browse the repository at this point in the history
  • Loading branch information
makylfang committed Jan 10, 2024
1 parent 043114b commit 910e61e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ class AuthProvider {
u.searchParams.set('sessionID', session.id)

const popup = new Popup(u.toString())
await popup.open('login')
await popup.open()
await this.waitForConnect()
return
}
Expand All @@ -427,7 +427,7 @@ class AuthProvider {

private async beginLogin(url: string): Promise<EthereumProvider> {
const popup = new Popup(url)
await popup.open('login')
await popup.open()
return await this.waitForConnect()
}

Expand Down
10 changes: 2 additions & 8 deletions src/popup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,10 @@ class Popup {
private window: Window | null
constructor(public url: string) {}

public open(type: 'login'): Promise<unknown>
public open(type: 'request'): Promise<JsonRpcResponse<unknown>>
public open(type: 'login' | 'request' = 'login') {
public open() {
const windowFeatures = getWindowFeatures()
this.window = window.open(this.url, '_blank', windowFeatures)
if (type == 'login') {
return this.getWindowResponse()
} else {
return this.requestHandler()
}
return this.getWindowResponse()
}

private getWindowResponse() {
Expand Down

0 comments on commit 910e61e

Please sign in to comment.