Skip to content

Commit a4f8fd7

Browse files
committed
Merge branch 'rc' into 'main'
refactor: move has trial plan marker from sessionStorage to route query See merge request locker/web!242
2 parents 925046f + 9c2dd2a commit a4f8fd7

6 files changed

Lines changed: 6 additions & 14 deletions

File tree

src/renderer/components/pages/plans/PlansTable.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,7 @@ export default {
146146
path: '/',
147147
maxAge: 3600 * 24
148148
})
149-
window.sessionStorage.setItem('keepTrialPlan', '1')
150-
this.$router.push(this.localeRoute({ path: '/register' }))
149+
this.$router.push(this.localeRoute({ path: '/register?hasPlan=1' }))
151150
},
152151
choosePlan (alias) {
153152
if (alias === 'pm_free') {

src/renderer/pages/plans-family-promotion.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,9 +375,8 @@ export default {
375375
if (this.$store.state.isLoggedIn) {
376376
this.$router.replace(this.localePath('/manage-plans'))
377377
} else {
378-
window.sessionStorage.setItem('keepTrialPlan', '1')
379378
this.$router.replace(
380-
this.localePath('/register?utm_source=plans-family-promotion')
379+
this.localePath('/register?utm_source=plans-family-promotion&hasPlan=1')
381380
)
382381
}
383382
}

src/renderer/pages/private-email.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,8 +300,7 @@ export default {
300300
path: '/',
301301
maxAge: 3600 * 24
302302
})
303-
window.sessionStorage.setItem('keepTrialPlan', '1')
304-
this.$router.replace(this.localePath('/register'))
303+
this.$router.replace(this.localePath('/register?hasPlan=1'))
305304
}
306305
}
307306
}

src/renderer/pages/promotion-1.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -555,8 +555,7 @@ export default {
555555
if (this.$store.state.isLoggedIn) {
556556
this.$router.replace(this.localePath('/manage-plans'))
557557
} else {
558-
window.sessionStorage.setItem('keepTrialPlan', '1')
559-
this.$router.replace(this.localePath('/register?utm_source=plans-promotion'))
558+
this.$router.replace(this.localePath('/register?utm_source=plans-promotion&hasPlan=1'))
560559
}
561560
},
562561
claimOffer () {

src/renderer/pages/promotion.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -491,8 +491,7 @@ export default {
491491
if (this.$store.state.isLoggedIn) {
492492
this.$router.replace(this.localePath('/manage-plans'))
493493
} else {
494-
window.sessionStorage.setItem('keepTrialPlan', '1')
495-
this.$router.replace(this.localePath('/register?utm_source=plans-promotion'))
494+
this.$router.replace(this.localePath('/register?utm_source=plans-promotion&hasPlan=1'))
496495
}
497496
},
498497
claimOffer () {

src/renderer/pages/register.vue

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,7 @@ export default {
1616
domain: '.locker.io',
1717
path: '/'
1818
})
19-
} else if (process.client && window?.sessionStorage?.getItem('keepTrialPlan')) {
20-
// Keep the trial plan if needed
21-
window.sessionStorage.removeItem('keepTrialPlan')
22-
} else {
19+
} else if (!route.query.hasPlan) {
2320
// Auto set plan to premium
2421
$cookies.set('trial_plan', 'pm_premium', {
2522
domain: '.locker.io',

0 commit comments

Comments
 (0)