From 14237cff777acee47cf060aa81823b0dc25f3afa Mon Sep 17 00:00:00 2001 From: hakui Date: Sat, 18 Feb 2017 17:33:00 -0600 Subject: [PATCH 1/3] clears notif number from title when marking as read --- src/components/notifications/notifications.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/notifications/notifications.js b/src/components/notifications/notifications.js index 7dbbf588..3f9fe3b4 100644 --- a/src/components/notifications/notifications.js +++ b/src/components/notifications/notifications.js @@ -26,6 +26,7 @@ const Notifications = { watch: { unseenCount (count) { this.$store.dispatch('setPageTitle', `(${count})`) + if (count==0) this.$store.dispatch('setPageTitle', '') } }, methods: { From af913463289d27155993e1621e47ee9a57681079 Mon Sep 17 00:00:00 2001 From: hakui Date: Sat, 18 Feb 2017 17:38:56 -0600 Subject: [PATCH 2/3] changed to if-else to save on one line --- src/components/notifications/notifications.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/notifications/notifications.js b/src/components/notifications/notifications.js index 3f9fe3b4..e872a2e5 100644 --- a/src/components/notifications/notifications.js +++ b/src/components/notifications/notifications.js @@ -25,8 +25,8 @@ const Notifications = { }, watch: { unseenCount (count) { - this.$store.dispatch('setPageTitle', `(${count})`) - if (count==0) this.$store.dispatch('setPageTitle', '') + if (count>0) this.$store.dispatch('setPageTitle', `(${count})`) + else this.$store.dispatch('setPageTitle', '') } }, methods: { From df3ffdd9056ef7ebe451eaed4beaeafe20257818 Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Sun, 19 Feb 2017 12:19:47 +0100 Subject: [PATCH 3/3] Follow style guide (https://github.com/feross/standard) --- src/components/notifications/notifications.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/notifications/notifications.js b/src/components/notifications/notifications.js index e872a2e5..d6a6bdb5 100644 --- a/src/components/notifications/notifications.js +++ b/src/components/notifications/notifications.js @@ -25,8 +25,11 @@ const Notifications = { }, watch: { unseenCount (count) { - if (count>0) this.$store.dispatch('setPageTitle', `(${count})`) - else this.$store.dispatch('setPageTitle', '') + if (count > 0) { + this.$store.dispatch('setPageTitle', `(${count})`) + } else { + this.$store.dispatch('setPageTitle', '') + } } }, methods: {