Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion apps/frontend/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,6 @@ export default defineNuxtConfig({
},
},
modules: [
'@pinia/nuxt',
'floating-vue/nuxt',
// Sentry causes rollup-plugin-inject errors in dev, only enable in production
...(isProduction() ? ['@sentry/nuxt/module'] : []),
Expand Down
3 changes: 0 additions & 3 deletions apps/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
"@modrinth/moderation": "workspace:*",
"@modrinth/ui": "workspace:*",
"@modrinth/utils": "workspace:*",
"@pinia/nuxt": "^0.11.3",
"@sentry/nuxt": "^10.33.0",
"@tanstack/vue-query": "^5.90.7",
"@types/three": "^0.172.0",
Expand All @@ -69,8 +68,6 @@
"lru-cache": "^11.2.4",
"markdown-it": "14.1.0",
"pathe": "^1.1.2",
"pinia": "^3.0.0",
"pinia-plugin-persistedstate": "^4.4.1",
"prettier": "^3.6.2",
"qrcode.vue": "^3.4.0",
"semver": "^7.5.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ async function closeReport(reply = false) {
closed: true,
},
})
updateThread(props.report.thread)
await refreshReportCaches()
didCloseReport.value = true
} catch (err: any) {
addNotification({
Expand All @@ -292,7 +292,7 @@ async function reopenReport() {
closed: false,
},
})
updateThread(props.report.thread)
await refreshReportCaches()
didCloseReport.value = false
} catch (err: any) {
addNotification({
Expand All @@ -309,6 +309,18 @@ const formatDateTime = useFormatDateTime({
dateStyle: 'long',
})

async function refreshReportCaches() {
await Promise.allSettled([refreshThread(), refreshNuxtData('new-moderation-reports')])
}

async function refreshThread() {
const threadId = props.report.thread?.id ?? props.report.thread_id
if (!threadId) return

const thread = await useBaseFetch(`thread/${threadId}`)
updateThread(thread)
}

function updateThread(newThread: any) {
if (props.report.thread) {
Object.assign(props.report.thread, newThread)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,8 @@ async function batchMarkRemaining(verdict: 'safe' | 'unsafe') {
backToFileList()
}
}

emit('refetch')
} catch (error) {
console.error('Failed to batch update:', error)
addNotification({
Expand Down Expand Up @@ -534,6 +536,8 @@ async function updateDetailStatus(detailId: string, verdict: 'safe' | 'unsafe')
text: `This issue has been flagged as malicious.${otherText}`,
})
}

emit('refetch')
} catch (error) {
console.error('Failed to update detail status:', error)
addNotification({
Expand Down
Loading
Loading