Fetch notification count only when logged in

This commit is contained in:
wvffle 2022-07-21 20:25:34 +00:00 committed by Georg Krause
parent a69ac8a17b
commit 9d8465c950
2 changed files with 20 additions and 18 deletions

View File

@ -1,4 +1,4 @@
FROM gitpod/workspace-full:2022-07-17-14-41-27
FROM gitpod/workspace-full:2022-07-12-11-05-29
USER gitpod
RUN sudo apt update -y \

View File

@ -95,6 +95,7 @@ const moderationNotifications = computed(() =>
)
onMounted(async () => {
if (store.state.auth.authenticated) {
const [edits, reports, requests] = await Promise.all([
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 } })),
@ -115,6 +116,7 @@ onMounted(async () => {
type: 'pendingReviewReports',
value: reports.data.count
})
}
})
const isProduction = import.meta.env.PROD