Skip to content
Snippets Groups Projects
Commit 9d8465c9 authored by Kasper Seweryn's avatar Kasper Seweryn :pancakes: Committed by Georg Krause
Browse files

Fetch notification count only when logged in

parent a69ac8a1
No related branches found
No related tags found
No related merge requests found
FROM gitpod/workspace-full:2022-07-17-14-41-27 FROM gitpod/workspace-full:2022-07-12-11-05-29
USER gitpod USER gitpod
RUN sudo apt update -y \ RUN sudo apt update -y \
......
...@@ -95,6 +95,7 @@ const moderationNotifications = computed(() => ...@@ -95,6 +95,7 @@ const moderationNotifications = computed(() =>
) )
onMounted(async () => { onMounted(async () => {
if (store.state.auth.authenticated) {
const [edits, reports, requests] = await Promise.all([ const [edits, reports, requests] = await Promise.all([
axios.get('mutations/', { params: { page_size: 1, q: 'is_approved:null' } }).catch(() => ({ data: { count: 0 } })), axios.get('mutations/', { params: { page_size: 1, q: 'is_approved:null' } }).catch(() => ({ data: { count: 0 } })),
axios.get('manage/moderation/reports/', { params: { page_size: 1, q: 'resolved:no' } }).catch(() => ({ data: { count: 0 } })), axios.get('manage/moderation/reports/', { params: { page_size: 1, q: 'resolved:no' } }).catch(() => ({ data: { count: 0 } })),
...@@ -115,6 +116,7 @@ onMounted(async () => { ...@@ -115,6 +116,7 @@ onMounted(async () => {
type: 'pendingReviewReports', type: 'pendingReviewReports',
value: reports.data.count value: reports.data.count
}) })
}
}) })
const isProduction = import.meta.env.PROD const isProduction = import.meta.env.PROD
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment