-
-
-
+
+
+
Reject
-
-
+
+
+
Withhold
-
-
+
+
+
Approve
@@ -428,14 +446,15 @@ import {
BrushCleaningIcon,
CheckIcon,
DropdownIcon,
- EyeOffIcon,
FileTextIcon,
KeyboardIcon,
LeftArrowIcon,
+ LinkIcon,
ListBulletedIcon,
LockIcon,
RightArrowIcon,
ScaleIcon,
+ SpinnerIcon,
ToggleLeftIcon,
ToggleRightIcon,
XIcon,
@@ -760,6 +779,12 @@ const message = ref(
)
const generatedMessage = ref(persistedGeneratedMessage.generated === true)
const loadingMessage = ref(false)
+const moderationDecision = ref
(null)
+const loadingModerationDecision = computed(() => moderationDecision.value !== null)
+const approveSendStatus = computed(() => {
+ const requested = projectV2.value.requested_status
+ return requested ?? 'approved'
+})
const done = ref(false)
function persistGeneratedMessageState() {
@@ -1074,6 +1099,7 @@ function resetProgress() {
done.value = false
clearGeneratedMessageState()
loadingMessage.value = false
+ moderationDecision.value = null
localStorage.removeItem(`modpack-permissions-${projectV2.value.id}`)
localStorage.removeItem(`modpack-permissions-index-${projectV2.value.id}`)
@@ -1190,7 +1216,7 @@ function handleKeybinds(event: KeyboardEvent) {
tryResetProgress: resetProgress,
tryExitModeration: handleExit,
- tryApprove: () => sendMessage(projectV2.value.requested_status ?? 'approved'),
+ tryApprove: () => sendMessage(approveSendStatus.value),
tryReject: () => sendMessage('rejected'),
tryWithhold: () => sendMessage('withheld'),
tryEditMessage: goBackToStages,
@@ -1977,6 +2003,7 @@ async function sendMessage(status: ProjectStatus) {
return
}
+ moderationDecision.value = status
try {
await useBaseFetch(`project/${projectId}`, {
method: 'PATCH',
@@ -2026,6 +2053,8 @@ async function sendMessage(status: ProjectStatus) {
text: 'Failed to submit moderation decision. Please try again.',
type: 'error',
})
+ } finally {
+ moderationDecision.value = null
}
}
diff --git a/packages/ui/src/components/base/Badge.vue b/packages/ui/src/components/base/Badge.vue
index e8bf21d2d4..3586fd0af7 100644
--- a/packages/ui/src/components/base/Badge.vue
+++ b/packages/ui/src/components/base/Badge.vue
@@ -21,10 +21,10 @@
{{ formatMessage(messages.approvedLabel) }}
- {{ formatMessage(messages.unlistedLabel) }}
+ {{ formatMessage(messages.unlistedLabel) }}
- {{ formatMessage(messages.withheldLabel) }}
+ {{ formatMessage(messages.withheldLabel) }}
{{ formatMessage(messages.privateLabel) }}
@@ -89,9 +89,9 @@ import {
BugIcon,
CalendarIcon,
CheckIcon,
- EyeOffIcon,
FileTextIcon,
GlobeIcon,
+ LinkIcon,
LockIcon,
ModrinthIcon,
ScaleIcon,