Move download status subscription to "ChapterCard"
Only re-render chapters whose download status has changed instead of the whole list everytime a download status change was received
This commit is contained in:
@@ -30,7 +30,7 @@ import { Chapters } from '@/modules/chapter/services/Chapters.ts';
|
||||
|
||||
export const ChapterUpdateCard = ({ chapter }: { chapter: ChapterUpdateListFieldsFragment }) => {
|
||||
const { manga } = chapter;
|
||||
const download = Chapters.getDownloadStatusFromCache(chapter.id);
|
||||
const download = Chapters.useDownloadStatusFromCache(chapter.id);
|
||||
|
||||
const { t } = useTranslation();
|
||||
const location = useLocation();
|
||||
@@ -112,7 +112,7 @@ export const ChapterUpdateCard = ({ chapter }: { chapter: ChapterUpdateListField
|
||||
</TypographyMaxLines>
|
||||
</Box>
|
||||
</Box>
|
||||
{download && <DownloadStateIndicator download={download} />}
|
||||
<DownloadStateIndicator chapterId={chapter.id} />
|
||||
{download?.state === DownloadState.Error && (
|
||||
<Tooltip title={t('global.button.retry')}>
|
||||
<IconButton
|
||||
|
||||
Reference in New Issue
Block a user