增加过滤记录中的空白值。
This commit is contained in:
parent
d817024bf3
commit
a3fb9b656b
|
@ -1,7 +1,7 @@
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import { useAtomValue, useSetAtom } from 'jotai';
|
import { useAtomValue, useSetAtom } from 'jotai';
|
||||||
import { atomWithStorage } from 'jotai/utils';
|
import { atomWithStorage } from 'jotai/utils';
|
||||||
import { isEqual, reduce } from 'lodash-es';
|
import { isEqual, isNil, reduce } from 'lodash-es';
|
||||||
import { useCallback, useMemo } from 'react';
|
import { useCallback, useMemo } from 'react';
|
||||||
import { v4 } from 'uuid';
|
import { v4 } from 'uuid';
|
||||||
import { SchemeContent, SchemeStorage, SchemeType } from '../models';
|
import { SchemeContent, SchemeStorage, SchemeType } from '../models';
|
||||||
|
@ -47,6 +47,7 @@ export function useSchemeList(): Pick<SchemeContent<SchemeStorage>, 'id' | 'name
|
||||||
const sortedSchemes = useMemo(
|
const sortedSchemes = useMemo(
|
||||||
() =>
|
() =>
|
||||||
schemes
|
schemes
|
||||||
|
.filter((item) => !isNil(item))
|
||||||
.sort((a, b) => dayjs(b.createdAt).diff(dayjs(a.createdAt)))
|
.sort((a, b) => dayjs(b.createdAt).diff(dayjs(a.createdAt)))
|
||||||
.map(({ id, name, createdAt, type }) => ({ id, name, createdAt, type })),
|
.map(({ id, name, createdAt, type }) => ({ id, name, createdAt, type })),
|
||||||
[schemes],
|
[schemes],
|
||||||
|
|
Loading…
Reference in New Issue
Block a user