mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-12-16 14:49:23 +08:00
fix(onboarding): encode welcome page info
This commit is contained in:
parent
040c3bc45a
commit
7907b8fdd1
1 changed files with 11 additions and 5 deletions
|
|
@ -29,11 +29,7 @@ class PageRouterStore extends NylasStore
|
||||||
if isFirstAccount
|
if isFirstAccount
|
||||||
@_onMoveToPage('initial-preferences', {account: json})
|
@_onMoveToPage('initial-preferences', {account: json})
|
||||||
Actions.recordUserEvent('First Account Linked')
|
Actions.recordUserEvent('First Account Linked')
|
||||||
account = AccountStore.accounts()[0]
|
@openWelcomePage()
|
||||||
n1_id = NylasEnv.config.get("updateIdentity")
|
|
||||||
params = "?n1_id=#{n1_id}&email_address=#{account.emailAddress}&provider=#{account.provider}"
|
|
||||||
{shell} = require('electron')
|
|
||||||
shell.openExternal("https://nylas.com/welcome#{params}", activate: false)
|
|
||||||
else
|
else
|
||||||
# When account JSON is received, we want to notify external services
|
# When account JSON is received, we want to notify external services
|
||||||
# that it succeeded. Unfortunately in this case we're likely to
|
# that it succeeded. Unfortunately in this case we're likely to
|
||||||
|
|
@ -47,6 +43,16 @@ class PageRouterStore extends NylasStore
|
||||||
_onWindowPropsChanged: ({page, pageData}={}) =>
|
_onWindowPropsChanged: ({page, pageData}={}) =>
|
||||||
@_onMoveToPage(page, pageData)
|
@_onMoveToPage(page, pageData)
|
||||||
|
|
||||||
|
openWelcomePage: ->
|
||||||
|
encode = (str) -> encodeURIComponent(new Buffer(str).toString('base64'))
|
||||||
|
account = AccountStore.accounts()[0]
|
||||||
|
n1_id = encode(NylasEnv.config.get("updateIdentity"))
|
||||||
|
email = encode(account.emailAddress)
|
||||||
|
provider = encode(account.provider)
|
||||||
|
params = "?n=#{n1_id}&e=#{email}&p=#{provider}"
|
||||||
|
{shell} = require('electron')
|
||||||
|
shell.openExternal("https://nylas.com/welcome#{params}", activate: false)
|
||||||
|
|
||||||
page: -> @_page
|
page: -> @_page
|
||||||
|
|
||||||
pageData: -> @_pageData
|
pageData: -> @_pageData
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue