fix: ability to open a new tab on iOS Safari (#1516)

* fix: ability to open a new tab on iOS Safari

* chore: fix `https deprecation` warning

* chore: better variable naming
This commit is contained in:
Vardan Hakobyan
2022-09-12 13:11:48 +04:00
committed by GitHub
parent 5d39934e47
commit 73ef93c1db
2 changed files with 3 additions and 1 deletions

View File

@@ -1,13 +1,14 @@
import { SNApplication } from '@standardnotes/snjs'
export function openSubscriptionDashboard(application: SNApplication): void {
const windowProxy = window.open('', '_blank')
application
.getNewSubscriptionToken()
.then((token) => {
if (!token) {
return
}
window.open(`${window.dashboardUrl}?subscription_token=${token}`)
;(windowProxy as WindowProxy).location = `${window.dashboardUrl}?subscription_token=${token}`
})
.catch(console.error)
}