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:
@@ -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);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user