Properly update reader desktop nav bar download button

Did not update according to download updates due to not subscribing to the fragment changes

Regression 257c0c8e10
This commit is contained in:
schroda
2025-01-17 00:52:54 +01:00
parent 7818fb450d
commit 9ac1009e22

View File

@@ -28,7 +28,7 @@ import { userReaderStatePagesContext } from '@/modules/reader/contexts/state/Rea
const DownloadButton = ({ currentChapter }: Required<Pick<ReaderStateChapters, 'currentChapter'>>) => {
const { t } = useTranslation();
const downloadChapter = Chapters.getDownloadStatusFromCache(currentChapter?.id ?? -1);
const downloadStatus = Chapters.useDownloadStatusFromCache(currentChapter?.id ?? -1);
if (currentChapter && Chapters.isDownloaded(currentChapter)) {
return (
@@ -40,8 +40,8 @@ const DownloadButton = ({ currentChapter }: Required<Pick<ReaderStateChapters, '
);
}
if (downloadChapter) {
return <DownloadStateIndicator chapterId={downloadChapter.chapter.id} />;
if (downloadStatus) {
return <DownloadStateIndicator chapterId={downloadStatus.chapter.id} />;
}
return (