You've already forked AstralRinth
forked from didirus/AstralRinth
attempt to safeguard some potential errors on user and collection pages (#5169)
* attempt to safeguard some potential errors on user and collection pages * prepr
This commit is contained in:
@@ -174,12 +174,12 @@
|
|||||||
<IntlFormatted
|
<IntlFormatted
|
||||||
:message-id="messages.projectsCountLabel"
|
:message-id="messages.projectsCountLabel"
|
||||||
:values="{
|
:values="{
|
||||||
count: formatCompactNumber(projects.length || 0),
|
count: formatCompactNumber(projects?.length || 0),
|
||||||
type: formatMessage(
|
type: formatMessage(
|
||||||
commonProjectTypeSentenceMessages[
|
commonProjectTypeSentenceMessages[
|
||||||
projectTypes.length === 1 ? projectTypes[0] : 'project'
|
projectTypes.length === 1 ? projectTypes[0] : 'project'
|
||||||
],
|
],
|
||||||
{ count: projects.length || 0 },
|
{ count: projects?.length || 0 },
|
||||||
),
|
),
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -757,11 +757,11 @@ useSeoMeta({
|
|||||||
const projectTypes = computed(() => {
|
const projectTypes = computed(() => {
|
||||||
const obj = {}
|
const obj = {}
|
||||||
|
|
||||||
if (collections.value.length > 0) {
|
if (collections.value?.length > 0) {
|
||||||
obj.collection = true
|
obj.collection = true
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const project of projects.value) {
|
for (const project of projects.value ?? []) {
|
||||||
obj[project.project_type] = true
|
obj[project.project_type] = true
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -772,7 +772,7 @@ const projectTypes = computed(() => {
|
|||||||
const sumDownloads = computed(() => {
|
const sumDownloads = computed(() => {
|
||||||
let sum = 0
|
let sum = 0
|
||||||
|
|
||||||
for (const project of projects.value) {
|
for (const project of projects.value ?? []) {
|
||||||
sum += project.downloads
|
sum += project.downloads
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user