only fetch privileged resources when appropriate #288

Closed
flisk wants to merge 1 commits from flisk:only-fetch-when-authenticated into develop
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 })