Remove "downloading" text for active chapter downloads

Instead, just show the progress, even if it is 0%
This commit is contained in:
schroda
2024-10-17 01:30:52 +02:00
parent 0e8ddd4717
commit 03c1fe2172

View File

@@ -24,6 +24,9 @@ const DOWNLOAD_STATE_TO_TRANSLATION_KEY_MAP: { [state in DownloadState]: Transla
export const DownloadStateIndicator = ({ download }: { download: ChapterDownloadStatus }) => { export const DownloadStateIndicator = ({ download }: { download: ChapterDownloadStatus }) => {
const { t } = useTranslation(); const { t } = useTranslation();
const isDownloading = download.state === DownloadState.Downloading;
const isPartiallyDownloaded = download.progress !== 0;
return ( return (
<Box <Box
sx={{ sx={{
@@ -54,8 +57,10 @@ export const DownloadStateIndicator = ({ download }: { download: ChapterDownload
}} }}
> >
<> <>
{download.progress !== 0 && `${Math.round(download.progress * 100)}%`} {isDownloading && `${Math.round(download.progress * 100)}%`}
{download.progress === 0 && t(DOWNLOAD_STATE_TO_TRANSLATION_KEY_MAP[download.state])} {!isDownloading &&
!isPartiallyDownloaded &&
t(DOWNLOAD_STATE_TO_TRANSLATION_KEY_MAP[download.state])}
</> </>
</Typography> </Typography>
</Box> </Box>