mirror of
https://github.com/modrinth/code.git
synced 2026-08-26 17:44:50 +00:00
fix moderation messages + add legacy message (#6914)
This commit is contained in:
@@ -109,8 +109,8 @@
|
||||
</template>
|
||||
</div>
|
||||
<ConversationThread
|
||||
v-if="thread"
|
||||
:thread="thread"
|
||||
v-if="prefixedThread"
|
||||
:thread="prefixedThread"
|
||||
:project="project"
|
||||
:set-status="setStatus"
|
||||
:current-member="currentMember ?? undefined"
|
||||
@@ -151,6 +151,7 @@ import {
|
||||
} from '@modrinth/ui'
|
||||
import { isStaff } from '@modrinth/utils'
|
||||
import { useQueryClient } from '@tanstack/vue-query'
|
||||
import dayjs from 'dayjs'
|
||||
import { computed, watch } from 'vue'
|
||||
|
||||
import ConversationThread from '~/components/ui/thread/ConversationThread.vue'
|
||||
@@ -217,6 +218,26 @@ const {
|
||||
thread,
|
||||
} = injectProjectPageContext()
|
||||
|
||||
const THREADS_RELEASE_DATE = '2023-08-05T12:00:00-07:00'
|
||||
|
||||
const prefixedThread = computed(() => {
|
||||
const projectDate = project.value?.queued ?? project.value?.approved ?? project.value?.published
|
||||
if (thread.value && projectDate && dayjs(projectDate).isBefore(dayjs(THREADS_RELEASE_DATE))) {
|
||||
const newThread = JSON.parse(JSON.stringify(thread.value))
|
||||
newThread.messages.unshift({
|
||||
id: '69',
|
||||
author_id: null,
|
||||
body: {
|
||||
type: 'legacy_project_message',
|
||||
},
|
||||
created: THREADS_RELEASE_DATE,
|
||||
hide_identity: false,
|
||||
})
|
||||
return newThread
|
||||
}
|
||||
return thread.value
|
||||
})
|
||||
|
||||
const canAccess = computed(() => !!currentMember.value)
|
||||
const staff = computed(() => isStaff(currentMember.value?.user))
|
||||
const userFacingUiVisible = computed(
|
||||
|
||||
Reference in New Issue
Block a user