fix: queue store stability + persistence (#5909)

* fix: queue store stability + persistence

* fix: lint

* feat: set to draft btn

* feat: migrate to indexed db rather than local storage for moderation checklist storage (keep session + perms alone)

* fix: storage cleanup + lint

* fix: invalidation fixes
This commit is contained in:
Calum H.
2026-04-27 16:39:32 +00:00
committed by GitHub
parent a2eed001b2
commit 3f8fd9cb56
19 changed files with 1548 additions and 387 deletions
@@ -273,7 +273,7 @@ async function closeReport(reply = false) {
closed: true,
},
})
updateThread(props.report.thread)
await refreshReportCaches()
didCloseReport.value = true
} catch (err: any) {
addNotification({
@@ -292,7 +292,7 @@ async function reopenReport() {
closed: false,
},
})
updateThread(props.report.thread)
await refreshReportCaches()
didCloseReport.value = false
} catch (err: any) {
addNotification({
@@ -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)