Skip to content

Commit 72c75a6

Browse files
committed
fix: slice miss the last item
1 parent ef0c689 commit 72c75a6

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/pages/index.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export default function Page() {
5959
error: BoundError,
6060
} = useBoundProgress();
6161
const { data: amountData, error: amountError } = useAmountPerDay();
62-
const days = amountData?.data?.slice(0, -1).map((item) => item.date);
62+
const days = amountData?.data?.slice(0).map((item) => item.date);
6363

6464
const error =
6565
latestGamesError ||
@@ -95,7 +95,7 @@ export default function Page() {
9595
<div className="col-span-2 sm:col-span-4">
9696
<DailyAmountChart
9797
days={days}
98-
data={amountData?.data?.slice(0, -1).map((item) => item.amount)}
98+
data={amountData?.data?.slice(0).map((item) => item.amount)}
9999
compact
100100
/>
101101
</div>
@@ -144,8 +144,8 @@ export default function Page() {
144144

145145
<div className="col-span-2 sm:col-span-4">
146146
<InprogressChart
147-
days={boundData?.data?.slice(0, -1).map((item) => item.date)}
148-
data={boundData?.data?.slice(0, -1).map((item) => item.amount)}
147+
days={boundData?.data?.slice(0).map((item) => item.date)}
148+
data={boundData?.data?.slice(0).map((item) => item.amount)}
149149
compact={false}
150150
/>
151151
</div>
@@ -255,16 +255,16 @@ export default function Page() {
255255
</div>
256256
) : (
257257
<SlidableList
258-
items={(credits as PageListResponse<Credit>)?.data?.slice(0, 5).map(
259-
(g, i) => ({
258+
items={(credits as PageListResponse<Credit>)?.data
259+
?.slice(0, 5)
260+
.map((g, i) => ({
260261
id: g.address,
261262
element: (
262263
<div className={CARD_HEIGHT} key={g.address}>
263264
<CreditCard credit={g} index={i} />
264265
</div>
265266
),
266-
})
267-
)}
267+
}))}
268268
/>
269269
)}
270270
</div>

0 commit comments

Comments
 (0)