From 910e61e2986fd58d84944f0502e19ad206c7390c Mon Sep 17 00:00:00 2001 From: makylfang Date: Wed, 10 Jan 2024 16:49:08 +0400 Subject: [PATCH] Fixing merge issues --- src/index.ts | 4 ++-- src/popup.ts | 10 ++-------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/index.ts b/src/index.ts index 85b4e3b..7f58ca5 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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 } @@ -427,7 +427,7 @@ class AuthProvider { private async beginLogin(url: string): Promise { const popup = new Popup(url) - await popup.open('login') + await popup.open() return await this.waitForConnect() } diff --git a/src/popup.ts b/src/popup.ts index 87daab0..6fd94fa 100644 --- a/src/popup.ts +++ b/src/popup.ts @@ -5,16 +5,10 @@ class Popup { private window: Window | null constructor(public url: string) {} - public open(type: 'login'): Promise - public open(type: 'request'): Promise> - 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() {