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

View File

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