Skip to content
Merged
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
15 changes: 11 additions & 4 deletions apps/frontend/src/providers/project-review/review-decision.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@ export async function applyReviewDecision(
onMessageSent: () => void,
): Promise<void> {
const threads = client.labrinth.threads_v3
const approving =
decision.status !== undefined && ['approved', 'unlisted', 'private'].includes(decision.status)
async function updateFacets() {
for (const facet of decision.facetUpdates) {
assertCurrent()
await threads.editIssueFacet(facet.id, facet.data)
}
}
assertCurrent()
if (approving) await updateFacets()
assertCurrent()
// Send thread messages after the status change so they appear below its message in the thread.
if (decision.status) {
Expand Down Expand Up @@ -69,9 +79,6 @@ export async function applyReviewDecision(
throw new ReviewIssuesError('message', error)
}
}
for (const facet of decision.facetUpdates) {
assertCurrent()
await threads.editIssueFacet(facet.id, facet.data)
}
if (!approving) await updateFacets()
assertCurrent()
}
Loading