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