Skip to content

Commit f1f43cc

Browse files
use await
1 parent 6829dc9 commit f1f43cc

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

src/components/helpers/DappCreateTkey/DappCreateTkey.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ export default {
2323
},
2424
methods: {
2525
...mapActions(['showWalletPopup']),
26-
openOnboarding() {
27-
this.showWalletPopup({ path: 'tkey' })
26+
async openOnboarding() {
27+
await this.showWalletPopup({ path: 'tkey' })
2828
this.showLoginTkey = false
2929
},
3030
},

src/handlers/Popup/PopupHandler.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class PopupHandler extends EventEmitter {
3333
}, 500)
3434
}
3535

36-
open() {
36+
async open() {
3737
// if window is already open
3838
if (!this.preopenInstanceId) {
3939
// try to open a window first
@@ -42,10 +42,10 @@ class PopupHandler extends EventEmitter {
4242
// if it's blocked, open streamwindow
4343
this.window = new StreamWindow({ url: this.url })
4444
}
45-
return Promise.resolve()
45+
return
4646
}
4747
this.window = new StreamWindow({ preopenInstanceId: this.preopenInstanceId })
48-
return this.window.open(this.url)
48+
await this.window.open(this.url)
4949
}
5050

5151
close() {

src/store/actions.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,11 +218,11 @@ export default {
218218
handleProviderChangeDeny('user denied provider change request')
219219
}
220220
},
221-
showWalletPopup(context, payload) {
221+
async showWalletPopup(context, payload) {
222222
const url = payload.path.includes('tkey') ? `${baseRoute}${payload.path || ''}` : `${baseRoute}wallet${payload.path || ''}`
223223
const finalUrl = `${url}?instanceId=${torus.instanceId}`
224224
const walletWindow = new PopupHandler({ url: finalUrl, features: FEATURES_DEFAULT_WALLET_WINDOW })
225-
walletWindow.open()
225+
await walletWindow.open()
226226
if (walletWindow.window.blur) walletWindow.window.blur()
227227
if (walletWindow.window.focus) setTimeout(walletWindow.window.focus(), 0)
228228
},

0 commit comments

Comments
 (0)