Update chapter

This commit is contained in:
schroda
2024-12-07 03:43:18 +01:00
parent 916abd3bb1
commit 965aa7215c
9 changed files with 365 additions and 18 deletions

View File

@@ -10,6 +10,7 @@ import { createContext, useContext } from 'react';
import { ReaderStateChapters } from '@/modules/reader/types/Reader.types.ts';
export const ReaderStateChaptersContext = createContext<ReaderStateChapters>({
mangaChapters: [],
chapters: [],
setReaderStateChapters: () => {},
});

View File

@@ -12,7 +12,7 @@ import { ReaderStateChaptersContext } from '@/modules/reader/contexts/state/Read
type TContext = ContextType<typeof ReaderStateChaptersContext>;
export const ReaderStateChaptersContextProvider = ({ children }: { children: ReactNode }) => {
const [state, setState] = useState<Omit<TContext, 'setReaderStateChapters'>>({ chapters: [] });
const [state, setState] = useState<Omit<TContext, 'setReaderStateChapters'>>({ mangaChapters: [], chapters: [] });
const value = useMemo(
() => ({