fix: issues

This commit is contained in:
IMB11 2025-07-28 17:06:57 +01:00
parent 54cfe29f7d
commit dc258de3c2
4 changed files with 14 additions and 11 deletions

View File

@ -153,7 +153,7 @@ export const descriptionNags: Nag[] = [
defineMessage({
id: 'nags.summary-too-short.description',
defaultMessage:
"Your summary is {length} characters. It's recommended to have at least {minChars} characters to provide users with enough information about your project.",
'Your summary is {length} characters. It should ideally be around {minChars} characters, one short sentence about your project.',
}),
{
length: context.project.description?.length || 0,

View File

@ -27,8 +27,8 @@ export const commonLinkDomains = {
],
}
export function isCommonUrl(url: string | undefined, commonDomains: string[]): boolean {
if (!url) return false
export function isCommonUrl(url: string | null, commonDomains: string[]): boolean {
if (url === null || url === '') return true
try {
const domain = new URL(url).hostname.toLowerCase()
return commonDomains.some((allowed) => domain.includes(allowed))
@ -37,8 +37,8 @@ export function isCommonUrl(url: string | undefined, commonDomains: string[]): b
}
}
export function isUncommonLicenseUrl(url: string | undefined, domains: string[]): boolean {
if (!url) return false
export function isUncommonLicenseUrl(url: string | null, domains: string[]): boolean {
if (url === null || url === '') return false
try {
const domain = new URL(url).hostname.toLowerCase()
return domains.some((uncommonDomain) => domain.includes(uncommonDomain))

View File

@ -130,7 +130,10 @@ export const tagsNags: Nag[] = [
)
const totalSelectedTags =
context.project.categories.length + (context.project.additional_categories?.length || 0)
return totalSelectedTags === categoriesForProjectType.length
return (
totalSelectedTags === categoriesForProjectType.length &&
context.project.project_type !== 'project'
)
},
link: {
path: 'settings/tags',

View File

@ -18,7 +18,7 @@ export type DonationPlatform =
| { short: 'ko-fi'; name: 'Ko-fi' }
| { short: 'other'; name: 'Other' }
export type ProjectType = 'mod' | 'modpack' | 'resourcepack' | 'shader'
export type ProjectType = 'mod' | 'modpack' | 'resourcepack' | 'shader' | 'project'
export type MonetizationStatus = 'monetized' | 'demonetized' | 'force-demonetized'
export type GameVersion = string
@ -69,10 +69,10 @@ export interface Project {
thread_id: ModrinthId
organization: ModrinthId
issues_url?: string
source_url?: string
wiki_url?: string
discord_url?: string
issues_url: string | null
source_url: string | null
wiki_url: string | null
discord_url: string | null
donation_urls: DonationLink<DonationPlatform>[]
published: string