fix: fixed incorrectly displaying new update entries

This commit is contained in:
Haoyu Xu
2024-12-19 15:27:09 +08:00
parent 8d2b39b172
commit 8840ef043f

View File

@@ -174,10 +174,11 @@ export default function Home() {
<section className={classes.content}> <section className={classes.content}>
<section className={classes.text}>{officalUpdate.length - operators.length} {i18n("new_op_wait_to_update")}</section> <section className={classes.text}>{officalUpdate.length - operators.length} {i18n("new_op_wait_to_update")}</section>
<section className={`${classes['styled-selection']}`}> <section className={`${classes['styled-selection']}`}>
{officalUpdate[officalUpdate.dates[0]].map((entry, index) => { {officalUpdate.dates.reduce((acc, cur) => {
if (index >= officalUpdate.length - operators.length) { const op = officalUpdate[cur];
return null return [...acc, ...op];
} }, []).slice(0, officalUpdate.length - operators.length)
.map((entry, index) => {
return ( return (
<Link <Link
reloadDocument reloadDocument