Always use "useShallow" for store selection
This commit is contained in:
@@ -30,17 +30,17 @@ import { FALLBACK_CHAPTER } from '@/features/chapter/Chapter.constants.ts';
|
||||
import { FALLBACK_MANGA } from '@/features/manga/Manga.constants.ts';
|
||||
import { ReaderExitButton } from '@/features/reader/overlay/navigation/components/ReaderExitButton.tsx';
|
||||
import { requestManager } from '@/lib/requests/RequestManager.ts';
|
||||
import { useReaderStoreShallow } from '@/features/reader/stores/ReaderStore.ts';
|
||||
import { useReaderStore } from '@/features/reader/stores/ReaderStore.ts';
|
||||
|
||||
const DEFAULT_MANGA = { ...FALLBACK_MANGA, title: '' };
|
||||
|
||||
const BaseReaderOverlayHeaderMobile = forwardRef<HTMLDivElement, MobileHeaderProps>(({ isVisible }, ref) => {
|
||||
const { t } = useTranslation();
|
||||
const popupState = usePopupState({ popupId: 'reader-overlay-more-menu', variant: 'popover' });
|
||||
const currentChapter = useReaderStoreShallow((state) => state.chapters.currentChapter);
|
||||
const currentChapter = useReaderStore((state) => state.chapters.currentChapter);
|
||||
|
||||
const manga = useReaderStoreShallow((state) => state.manga);
|
||||
const scrollbar = useReaderStoreShallow((state) => state.scrollbar);
|
||||
const manga = useReaderStore((state) => state.manga);
|
||||
const scrollbar = useReaderStore((state) => state.scrollbar);
|
||||
|
||||
const { id: mangaId, title } = manga ?? DEFAULT_MANGA;
|
||||
const { id: chapterId, name, realUrl, isBookmarked } = currentChapter ?? FALLBACK_CHAPTER;
|
||||
|
||||
Reference in New Issue
Block a user