File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed
apps/nextjs-app/src/features/app/blocks/space Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -34,15 +34,17 @@ export const BaseList = (props: IBaseListProps) => {
3434 } , [ allBaseList ] ) ;
3535
3636 const sortedList = useMemo ( ( ) => {
37- const withTime = baseIds . map ( ( baseId ) => {
38- const base = allBaseMap [ baseId ] || { } ;
39- const lastVisitTime = lastVisitBaseMap [ baseId ] ?. lastVisitTime ;
40-
41- return {
42- ...base ,
43- lastVisitTime,
44- } ;
45- } ) ;
37+ const withTime : ( IGetBaseVo & { lastVisitTime ?: string } ) [ ] = baseIds
38+ . map ( ( baseId ) => {
39+ const base = allBaseMap [ baseId ] ;
40+ if ( ! base ) return null ;
41+ const lastVisitTime = lastVisitBaseMap [ baseId ] ?. lastVisitTime ;
42+ return {
43+ ...base ,
44+ lastVisitTime,
45+ } ;
46+ } )
47+ . filter ( ( item ) => item !== null ) ;
4648
4749 /**
4850 * 1. Both have lastVisitTime: compare by lastVisitTime (recent first)
You can’t perform that action at this time.
0 commit comments