Clean up formatters from prev PR (#5254)

This commit is contained in:
Prospector
2026-02-02 01:38:36 -08:00
committed by GitHub
parent a207daef0d
commit 11f00be606
8 changed files with 45 additions and 59 deletions

View File

@@ -146,8 +146,7 @@
? 'All platforms'
: filtersRef?.selectedPlatforms
.map((x) => {
const message = getTagMessageOrDefault(x, 'loader')
return typeof message === 'string' ? message : formatMessage(message)
return formatLoader(formatMessage, x)
})
.join(', ')
}}
@@ -260,7 +259,7 @@ import {
Checkbox,
Combobox,
CopyCode,
getTagMessageOrDefault,
formatLoader,
NewModal,
TagItem,
useVIntl,
@@ -436,10 +435,7 @@ const formattedVersions = computed(() => {
if (secondLoaderPosition === -1) return -1
return firstLoaderPosition - secondLoaderPosition
})
.map((loader: string) => {
const message = getTagMessageOrDefault(loader, 'loader')
return typeof message === 'string' ? message : formatMessage(message)
}),
.map((loader: string) => formatLoader(formatMessage, loader)),
}
})

View File

@@ -66,11 +66,7 @@
v-for="category in categoryLists[header]"
:key="`category-${header}-${category.name}`"
:model-value="current.selectedTags.includes(category)"
:description="
typeof getTagMessageOrDefault(category.name, 'category') === 'string'
? getTagMessageOrDefault(category.name, 'category')
: formatMessage(getTagMessageOrDefault(category.name, 'category'))
"
:description="formatCategory(formatMessage, category.name)"
class="category-selector"
@update:model-value="toggleCategory(category)"
>
@@ -106,11 +102,7 @@
:key="`featured-category-${category.name}`"
class="category-selector"
:model-value="current.featuredTags.includes(category)"
:description="
typeof getTagMessageOrDefault(category.name, 'category') === 'string'
? getTagMessageOrDefault(category.name, 'category')
: formatMessage(getTagMessageOrDefault(category.name, 'category'))
"
:description="formatCategory(formatMessage, category.name)"
:disabled="current.featuredTags.length >= 3 && !current.featuredTags.includes(category)"
@update:model-value="toggleFeaturedCategory(category)"
>
@@ -143,8 +135,8 @@
import { getCategoryIcon, StarIcon, TriangleAlertIcon } from '@modrinth/assets'
import {
Checkbox,
formatCategory,
FormattedTag,
getTagMessageOrDefault,
injectProjectPageContext,
UnsavedChangesPopup,
useSavable,