Use stable array/object constants

This commit is contained in:
schroda
2026-03-20 03:02:52 +01:00
parent fcf1c7fa3f
commit 9ce273b5ce
19 changed files with 44 additions and 24 deletions

View File

@@ -21,6 +21,7 @@ import { getErrorMessage } from '@/lib/HelperFunctions.ts';
import { ChapterHistoryCard } from '@/features/history/components/ChapterHistoryCard.tsx';
import { Chapters } from '@/features/chapter/services/Chapters.ts';
import { useAppTitle } from '@/features/navigation-bar/hooks/useAppTitle.ts';
import { STABLE_EMPTY_ARRAY } from '@/base/Base.constants.ts';
export const History: React.FC = () => {
const { t } = useLingui();
@@ -39,7 +40,7 @@ export const History: React.FC = () => {
});
const hasNextPage = !!chapterHistoryData?.chapters.pageInfo.hasNextPage;
const endCursor = chapterHistoryData?.chapters.pageInfo.endCursor;
const readEntries = chapterHistoryData?.chapters.nodes ?? [];
const readEntries = chapterHistoryData?.chapters.nodes ?? STABLE_EMPTY_ARRAY;
const groupedHistory = useMemo(
() => Object.entries(Chapters.groupByDate(readEntries, 'lastReadAt')),
[readEntries],