From aa2d83ac2ccbf9a5f87571dd320982d91df8578e Mon Sep 17 00:00:00 2001 From: wvffle Date: Thu, 21 Jul 2022 18:19:21 +0000 Subject: [PATCH] Fix notification fetching --- front/src/components/Sidebar.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/front/src/components/Sidebar.vue b/front/src/components/Sidebar.vue index a29301312..033976f51 100644 --- a/front/src/components/Sidebar.vue +++ b/front/src/components/Sidebar.vue @@ -94,11 +94,11 @@ const moderationNotifications = computed(() => store.state.ui.notifications.pendingReviewRequests ) -Promise.resolve().then(async () => { +onMounted(async () => { const [edits, reports, requests] = await Promise.all([ - axios.get('mutations/', { params: { page_size: 1 } }), - axios.get('manage/moderation/reports/', { params: { page_size: 1 } }), - axios.get('manage/moderation/requests/', { params: { page_size: 1 } }) + axios.get('mutations/', { params: { page_size: 1 } }).catch(() => ({ data: { count: 0 } })), + axios.get('manage/moderation/reports/', { params: { page_size: 1 } }).catch(() => ({ data: { count: 0 } })), + axios.get('manage/moderation/requests/', { params: { page_size: 1 } }).catch(() => ({ data: { count: 0 } })) ]) store.commit('ui/incrementNotifications', {