Skip to content
Closed
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
18 changes: 12 additions & 6 deletions app/lib/admin/actions/moderation_case_resolve.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,20 @@ Closes the moderation case and updates the status based on the actions logged on
final appealedCase = await tx.lookupValue<ModerationCase>(dbService
.emptyKey
.append(ModerationCase, id: mc.appealedCaseId!));
final appealHadModeratedAction =
final appealedCaseHadModeratedAction =
appealedCase.getActionLog().hasModeratedAction();
if (appealHadModeratedAction) {
status = hasModeratedAction
? ModerationStatus.moderationReverted
: ModerationStatus.moderationUpheld;
final compositeActionLog = ModerationActionLog(entries: [
...appealedCase.getActionLog().entries,
...mc.getActionLog().entries,
]);
final compositeHasModeratedAction =
compositeActionLog.hasModeratedAction();
if (appealedCaseHadModeratedAction) {
status = compositeHasModeratedAction
? ModerationStatus.moderationUpheld
: ModerationStatus.moderationReverted;
} else {
status = hasModeratedAction
status = compositeHasModeratedAction
? ModerationStatus.noActionReverted
: ModerationStatus.noActionUpheld;
}
Expand Down
2 changes: 1 addition & 1 deletion app/test/admin/moderation_case_resolve_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ void main() {
reason: 'The package violated our policy.',
);

final mc = await _prepare(apply: true, appealCaseId: mc1.caseId);
final mc = await _prepare(apply: false, appealCaseId: mc1.caseId);
expect(await _close(mc.caseId), 'moderation-reverted');
});

Expand Down
Loading