only fetch privileged resources when appropriate
ci/woodpecker/pr/woodpecker Pipeline was successful Details

always doing these fetches regardless of whether they'll reasonably
succeed is silly and causes a bunch of spurious 403's, which end up as
noise in the server logs. instead, let's not do that.
This commit is contained in:
flisk 2023-03-08 14:36:40 +01:00
parent 14cedc5ed1
commit 7fe848d1b3
1 changed files with 8 additions and 0 deletions

View File

@ -399,6 +399,14 @@ const afterStoreSetup = async ({ store, i18n }) => {
])
// Start fetching things that don't need to block the UI
const currentUser = store.state.users.currentUser
if (currentUser) {
store.dispatch('fetchMutes')
store.dispatch('startFetchingAnnouncements')
if (currentUser.role === 'admin' || currentUser.role === 'moderator') {
store.dispatch('startFetchingReports')
}
}
getTOS({ store })
getStickers({ store })