From 17f00e6feac694fc2353a650c7f25c8ce226a2be Mon Sep 17 00:00:00 2001 From: Prospector <6166773+Prospector@users.noreply.github.com> Date: Wed, 11 Jan 2023 15:21:39 -0800 Subject: [PATCH] Fix moderation queue, moderation status card when approved, and invalid datapack packages (#907) * Fool behavior * Add leading underscore to packaged datapack package if it starts with a number * Hide mod status card for all approved statuses without mod messages * Fix project id sanitization --- components/ui/ModalModeration.vue | 10 +++++++--- pages/_type/_id.vue | 4 +--- pages/moderation.vue | 4 ++-- plugins/fileUtils.js | 12 ++++++++++-- 4 files changed, 20 insertions(+), 10 deletions(-) diff --git a/components/ui/ModalModeration.vue b/components/ui/ModalModeration.vue index 48c1764dd..0f980079c 100644 --- a/components/ui/ModalModeration.vue +++ b/components/ui/ModalModeration.vue @@ -133,10 +133,10 @@ export default { this.$defaultHeaders() ) + this.$refs.modal.hide() if (this.onClose !== null) { this.onClose() } - this.$refs.modal.hide() } catch (err) { this.$notify({ group: 'main', @@ -151,11 +151,15 @@ export default { show() { this.$refs.modal.show() this.moderationMessage = - this.project && this.project.moderator_message.message + this.project && + this.project.moderator_message && + this.project.moderator_message.message ? this.project.moderator_message.message : '' this.moderationMessageBody = - this.project && this.project.moderator_message.body + this.project && + this.project.moderator_message && + this.project.moderator_message.body ? this.project.moderator_message.body : '' }, diff --git a/pages/_type/_id.vue b/pages/_type/_id.vue index 625ede9b4..e735000a3 100644 --- a/pages/_type/_id.vue +++ b/pages/_type/_id.vue @@ -280,9 +280,7 @@