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:
@@ -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/*'",
|
||||||
|
|||||||
@@ -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)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user