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>
</Message>
) : data.enforcements.length > 0 ? (
) : data.enforcements.filter((i) => i !== 'NONE').length > 0 ? (
<Message type='warning'>
<h2 className='text-lg font-extrabold'> .</h2>
<p>
{data.enforcements.map((i) => (
<li key={i}>{botEnforcements[i].description}</li>
))}
{data.enforcements
.filter((i) => i !== 'NONE')
.map((i) => (
<li key={i}>{botEnforcements[i].description}</li>
))}
</p>
</Message>
) : (

View File

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