Skip to content

Commit 862c64e

Browse files
authored
fix: mark all prev issues as moderator resolved when submit review on project (#8150)
1 parent b3d8b7f commit 862c64e

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

‎apps/frontend/src/providers/project-review/review-decision.ts‎

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,16 @@ export async function applyReviewDecision(
3232
onMessageSent: () => void,
3333
): Promise<void> {
3434
const threads = client.labrinth.threads_v3
35+
const approving =
36+
decision.status !== undefined && ['approved', 'unlisted', 'private'].includes(decision.status)
37+
async function updateFacets() {
38+
for (const facet of decision.facetUpdates) {
39+
assertCurrent()
40+
await threads.editIssueFacet(facet.id, facet.data)
41+
}
42+
}
43+
assertCurrent()
44+
if (approving) await updateFacets()
3545
assertCurrent()
3646
// Send thread messages after the status change so they appear below its message in the thread.
3747
if (decision.status) {
@@ -69,9 +79,6 @@ export async function applyReviewDecision(
6979
throw new ReviewIssuesError('message', error)
7080
}
7181
}
72-
for (const facet of decision.facetUpdates) {
73-
assertCurrent()
74-
await threads.editIssueFacet(facet.id, facet.data)
75-
}
82+
if (!approving) await updateFacets()
7683
assertCurrent()
7784
}

0 commit comments

Comments
 (0)