Always use "useShallow" for store selection

This commit is contained in:
schroda
2025-09-21 00:28:38 +02:00
parent 5730690ae6
commit ed488f76dd
24 changed files with 85 additions and 86 deletions

View File

@@ -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;