mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-10-10 13:17:05 +08:00
fix(welcome): pass utm on to welcome
This commit is contained in:
parent
c41dade912
commit
3b21982af2
2 changed files with 11 additions and 3 deletions
|
@ -67,10 +67,18 @@ export function buildGmailAuthURL(sessionKey) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function buildWelcomeURL(welcomeRoot) {
|
export function buildWelcomeURL(welcomeRoot, {source}) {
|
||||||
const identityId = IdentityStore.identityId();
|
const identityId = IdentityStore.identityId();
|
||||||
if (!identityId) { NylasEnv.reportError(new Error("buildWelcomeURL: Can't find Nylas ID")) }
|
if (!identityId) { NylasEnv.reportError(new Error("buildWelcomeURL: Can't find Nylas ID")) }
|
||||||
return `${welcomeRoot}/welcome?n=${base64url(identityId)}`
|
const query = {
|
||||||
|
n: base64url(identityId),
|
||||||
|
utm_medium: "N1",
|
||||||
|
}
|
||||||
|
if (source) { query.utm_source = source }
|
||||||
|
return url.format({
|
||||||
|
pathname: `${welcomeRoot}/welcome`,
|
||||||
|
query: query,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export function runAuthRequest(accountInfo) {
|
export function runAuthRequest(accountInfo) {
|
||||||
|
|
|
@ -77,7 +77,7 @@ class OnboardingStore extends NylasStore {
|
||||||
*/
|
*/
|
||||||
_openWelcomePage() {
|
_openWelcomePage() {
|
||||||
// open the external welcome page
|
// open the external welcome page
|
||||||
const url = buildWelcomeURL(this.welcomeRoot);
|
const url = buildWelcomeURL(this.welcomeRoot, {source: "OnboardingStore"});
|
||||||
shell.openExternal(url, {activate: false});
|
shell.openExternal(url, {activate: false});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue