From cad508a9bb7186ad747dc42166d0d4737f611221 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Mon, 14 Oct 2019 14:25:08 +0200 Subject: [PATCH] Make sure welcome back only shows once and improve margins Signed-off-by: Thomas Citharel --- js/src/App.vue | 17 ++++++++++++----- js/src/views/Home.vue | 10 +++++++++- js/src/views/User/Login.vue | 1 + 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/js/src/App.vue b/js/src/App.vue index a0594589..7f66ce08 100644 --- a/js/src/App.vue +++ b/js/src/App.vue @@ -99,13 +99,20 @@ $mdi-font-path: "~@mdi/font/fonts"; body { // background: #f7f8fa; background: #ebebeb; + + main { + margin: 1rem auto; + } } - #mobilizon > .container > .message .message-header { - button.delete { - background: #4a4a4a; - } + #mobilizon > .container > .message { + margin: 1rem auto auto; + .message-header { + button.delete { + background: #4a4a4a; + } - color: #111; + color: #111; + } } diff --git a/js/src/views/Home.vue b/js/src/views/Home.vue index b1aa6721..e8418764 100644 --- a/js/src/views/Home.vue +++ b/js/src/views/Home.vue @@ -25,7 +25,7 @@
-
+
{{ $t('Welcome back {username}', { username: currentActor.displayName() }) }} @@ -183,6 +183,14 @@ export default class Home extends Vue { return this.config.name; } + get welcomeBack() { + return window.localStorage.getItem('welcome-back') === 'yes'; + } + + mounted() { + window.localStorage.removeItem('welcome-back'); + } + isToday(date: Date) { return (new Date(date)).toDateString() === (new Date()).toDateString(); } diff --git a/js/src/views/User/Login.vue b/js/src/views/User/Login.vue index e89a89d9..c7284928 100644 --- a/js/src/views/User/Login.vue +++ b/js/src/views/User/Login.vue @@ -169,6 +169,7 @@ export default class Login extends Vue { if (this.redirect) { await this.$router.push(this.redirect); } else { + window.localStorage.setItem('welcome-back', 'yes'); await this.$router.push({ name: RouteName.HOME }); } } catch (err) {