Fix Cypress tests and add a different welcome message when coming from

registration

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2019-10-15 17:33:02 +02:00
parent 5ebbb57d0e
commit 3c635ce4b4
7 changed files with 24 additions and 12 deletions

View File

@@ -108,6 +108,7 @@ export default class Register extends Vue {
});
if (data) {
this.validationSent = true;
window.localStorage.setItem('new-registered-user', 'yes');
if (this.userAlreadyActivated) {
await changeIdentity(this.$apollo.provider.defaultClient, data.registerPerson);

View File

@@ -25,9 +25,12 @@
</div>
</section>
<div class="container" v-if="config">
<section v-if="currentActor.id && welcomeBack">
<b-message type="is-info">
{{ $t('Welcome back {username}', { username: currentActor.displayName() }) }}
<section v-if="currentActor.id">
<b-message type="is-info" v-if="welcomeBack">
{{ $t('Welcome back {username}!', { username: currentActor.displayName() }) }}
</b-message>
<b-message type="is-info" v-if="newRegisteredUser">
{{ $t('Welcome to Mobilizon, {username}!', { username: currentActor.displayName() }) }}
</b-message>
</section>
<section v-if="currentActor.id && goingToEvents.size > 0" class="container">
@@ -187,8 +190,17 @@ export default class Home extends Vue {
return window.localStorage.getItem('welcome-back') === 'yes';
}
get newRegisteredUser() {
return window.localStorage.getItem('new-registered-user') === 'yes';
}
mounted() {
window.localStorage.removeItem('welcome-back');
if (window.localStorage.getItem('welcome-back')) {
window.localStorage.removeItem('welcome-back');
}
if (window.localStorage.getItem('new-registered-user')) {
window.localStorage.removeItem('new-registered-user');
}
}
isToday(date: Date) {