Compare commits

...

2 Commits

Author SHA1 Message Date
skinmaker1345
8ab66a3285 fix: do not show message when none is set 2025-08-19 00:43:44 +09:00
skinmaker1345
d1703b669d fix: do not filter none 2025-08-19 00:26:23 +09:00
2 changed files with 8 additions and 6 deletions

View File

@ -116,13 +116,15 @@ const Bots: NextPage<BotsProps> = ({ data, desc, date, user, theme, csrfToken })
. .
</p> </p>
</Message> </Message>
) : data.enforcements.length > 0 ? ( ) : data.enforcements.filter((i) => i !== 'NONE').length > 0 ? (
<Message type='warning'> <Message type='warning'>
<h2 className='text-lg font-extrabold'> .</h2> <h2 className='text-lg font-extrabold'> .</h2>
<p> <p>
{data.enforcements.map((i) => ( {data.enforcements
<li key={i}>{botEnforcements[i].description}</li> .filter((i) => i !== 'NONE')
))} .map((i) => (
<li key={i}>{botEnforcements[i].description}</li>
))}
</p> </p>
</Message> </Message>
) : ( ) : (

View File

@ -641,7 +641,7 @@ async function submitBot(
git: data.git, git: data.git,
url: data.url, url: data.url,
category: JSON.stringify(data.category), category: JSON.stringify(data.category),
enforcements: JSON.stringify(data.enforcements.filter((el) => el !== 'NONE')), enforcements: JSON.stringify(data.enforcements),
discord: data.discord, discord: data.discord,
state: 0, state: 0,
}) })
@ -751,7 +751,7 @@ async function updateBot(id: string, data: ManageBot): Promise<number> {
intro: data.intro, intro: data.intro,
desc: data.desc, desc: data.desc,
vanity: data.vanity, vanity: data.vanity,
enforcements: JSON.stringify(data.enforcements.filter((el) => el !== 'NONE')), enforcements: JSON.stringify(data.enforcements),
banner: data.banner, banner: data.banner,
bg: data.bg, bg: data.bg,
}) })