Skip to content

Commit 6587825

Browse files
committed
small fix
1 parent c007289 commit 6587825

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

widgets/src/components/HomeVisitList.js

+2-6
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,7 @@ export function HomeVisitList({ default_entries = 10 }) {
3333
if (isLoading || error) {
3434
return <Loading widget="Lista delle visite" error={error}></Loading>
3535
}
36-
37-
const all_visit_list = data.slice(0, numberOfEntries).map((v) => (
38-
<VisitTableItems visit={v} key={v._id}></VisitTableItems>
39-
));
40-
36+
4137
const current_visit_list = filterVisitsByDate(data, 'current').slice(0, numberOfEntries).map((v) => (
4238
<VisitTableItems visit={v} key={v._id}></VisitTableItems>
4339
));
@@ -46,7 +42,7 @@ export function HomeVisitList({ default_entries = 10 }) {
4642
<VisitTableItems visit={v} key={v._id}></VisitTableItems>
4743
));
4844

49-
const showButton = numberOfEntries <= all_visit_list.length;
45+
const showButton = numberOfEntries <= current_visit_list.length + future_visit_list.length;
5046

5147
return (
5248
<div className="">

0 commit comments

Comments
 (0)