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

@@ -14,6 +14,7 @@
"format": "prettier --write src/javascripts",
"lint": "NODE_OPTIONS=\"--max-old-space-size=4096\" eslint src/javascripts",
"start": "webpack-dev-server --config web.webpack.dev.js",
"start-secure": "yarn start --server-type https",
"test": "jest --config jest.config.js --coverage",
"tsc": "tsc --project tsconfig.json",
"upgrade:snjs": "ncu -u '@standardnotes/*'",

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)
}