From 7adc074d8d713c93bd035908850de56a48731d9e Mon Sep 17 00:00:00 2001 From: Ariel Juodziukynas Date: Sun, 29 Oct 2023 15:58:39 -0300 Subject: [PATCH] Fix missing resume download button when returning to downloads --- .../components/DownloadManagerItem/index.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/frontend/screens/DownloadManager/components/DownloadManagerItem/index.tsx b/src/frontend/screens/DownloadManager/components/DownloadManagerItem/index.tsx index f5216e3c15..ebc6a53871 100644 --- a/src/frontend/screens/DownloadManager/components/DownloadManagerItem/index.tsx +++ b/src/frontend/screens/DownloadManager/components/DownloadManagerItem/index.tsx @@ -40,6 +40,7 @@ const DownloadManagerItem = ({ element, current, state }: Props) => { const { amazon, epic, gog, showDialogModal } = useContext(ContextProvider) const { t } = useTranslation('gamepage') const { t: t2 } = useTranslation('translation') + const isPaused = state && ['idle', 'paused'].includes(state) const navigate = useNavigate() @@ -125,7 +126,7 @@ const DownloadManagerItem = ({ element, current, state }: Props) => { // using one element for the different states so it doesn't // lose focus from the button when using a game controller const handleSecondaryActionClick = () => { - if (state === 'paused') { + if (isPaused) { window.api.resumeCurrentDownload() } else if (state === 'running') { window.api.pauseCurrentDownload() @@ -148,7 +149,7 @@ const DownloadManagerItem = ({ element, current, state }: Props) => { } const secondaryActionIcon = () => { - if (state === 'paused') { + if (isPaused) { return } else if (state === 'running') { return @@ -179,7 +180,7 @@ const DownloadManagerItem = ({ element, current, state }: Props) => { } const secondaryIconTitle = () => { - if (state === 'paused') { + if (isPaused) { return t('queue.label.resume', 'Resume download') } else if (state === 'running') { return t('queue.label.pause', 'Pause download')