Skip to content

Commit 4d481f3

Browse files
authored
[Fix] missing resume download button when returning to downloads (#3171)
Fix missing resume download button when returning to downloads
1 parent 945ba5c commit 4d481f3

File tree

1 file changed

+4
-3
lines changed
  • src/frontend/screens/DownloadManager/components/DownloadManagerItem

1 file changed

+4
-3
lines changed

src/frontend/screens/DownloadManager/components/DownloadManagerItem/index.tsx

+4-3
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ const DownloadManagerItem = ({ element, current, state }: Props) => {
4040
const { amazon, epic, gog, showDialogModal } = useContext(ContextProvider)
4141
const { t } = useTranslation('gamepage')
4242
const { t: t2 } = useTranslation('translation')
43+
const isPaused = state && ['idle', 'paused'].includes(state)
4344

4445
const navigate = useNavigate()
4546

@@ -125,7 +126,7 @@ const DownloadManagerItem = ({ element, current, state }: Props) => {
125126
// using one element for the different states so it doesn't
126127
// lose focus from the button when using a game controller
127128
const handleSecondaryActionClick = () => {
128-
if (state === 'paused') {
129+
if (isPaused) {
129130
window.api.resumeCurrentDownload()
130131
} else if (state === 'running') {
131132
window.api.pauseCurrentDownload()
@@ -148,7 +149,7 @@ const DownloadManagerItem = ({ element, current, state }: Props) => {
148149
}
149150

150151
const secondaryActionIcon = () => {
151-
if (state === 'paused') {
152+
if (isPaused) {
152153
return <PlayIcon className="playIcon" />
153154
} else if (state === 'running') {
154155
return <PauseIcon className="pauseIcon" />
@@ -179,7 +180,7 @@ const DownloadManagerItem = ({ element, current, state }: Props) => {
179180
}
180181

181182
const secondaryIconTitle = () => {
182-
if (state === 'paused') {
183+
if (isPaused) {
183184
return t('queue.label.resume', 'Resume download')
184185
} else if (state === 'running') {
185186
return t('queue.label.pause', 'Pause download')

0 commit comments

Comments
 (0)