From 62d0bc47b333135f31abea90b4f5a3c28e608733 Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Wed, 1 Jul 2020 14:15:04 +0300 Subject: remove unnecessary fetchAndUpdate, change notifications fetcher to not double fetch --- src/components/notifications/notifications.js | 5 ----- 1 file changed, 5 deletions(-) (limited to 'src/components/notifications/notifications.js') diff --git a/src/components/notifications/notifications.js b/src/components/notifications/notifications.js index 26ffbab6..e999a18e 100644 --- a/src/components/notifications/notifications.js +++ b/src/components/notifications/notifications.js @@ -56,11 +56,6 @@ const Notifications = { components: { Notification }, - created () { - const { dispatch } = this.$store - - dispatch('fetchAndUpdateNotifications') - }, watch: { unseenCount (count) { if (count > 0) { -- cgit v1.2.3-70-g09d2 From a3e370e9f816e3c98028bf82e8ac020b8e294466 Mon Sep 17 00:00:00 2001 From: Shpuld Shpuldson Date: Wed, 1 Jul 2020 15:19:45 +0300 Subject: add initial fetching back in a more streamlined way --- src/components/notifications/notifications.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/components/notifications/notifications.js') diff --git a/src/components/notifications/notifications.js b/src/components/notifications/notifications.js index e999a18e..30187072 100644 --- a/src/components/notifications/notifications.js +++ b/src/components/notifications/notifications.js @@ -27,6 +27,11 @@ const Notifications = { seenToDisplayCount: DEFAULT_SEEN_TO_DISPLAY_COUNT } }, + created () { + const store = this.$store + const credentials = store.state.users.currentUser.credentials + notificationsFetcher.fetchAndUpdate({ store: this.$store, credentials }) + }, computed: { mainClass () { return this.minimalMode ? '' : 'panel panel-default' -- cgit v1.2.3-70-g09d2 From 9178908c1ea8d0ad99b4a631abb9594edc3765bf Mon Sep 17 00:00:00 2001 From: Shpuld Shpludson Date: Sun, 5 Jul 2020 06:54:12 +0000 Subject: Apply suggestion to src/components/notifications/notifications.js --- src/components/notifications/notifications.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/components/notifications/notifications.js') diff --git a/src/components/notifications/notifications.js b/src/components/notifications/notifications.js index 30187072..d8a327b0 100644 --- a/src/components/notifications/notifications.js +++ b/src/components/notifications/notifications.js @@ -30,7 +30,7 @@ const Notifications = { created () { const store = this.$store const credentials = store.state.users.currentUser.credentials - notificationsFetcher.fetchAndUpdate({ store: this.$store, credentials }) + notificationsFetcher.fetchAndUpdate({ store, credentials }) }, computed: { mainClass () { -- cgit v1.2.3-70-g09d2