Skip to content

[Fix] missing resume download button when returning to downloads #3171

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -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()
Expand All @@ -148,7 +149,7 @@ const DownloadManagerItem = ({ element, current, state }: Props) => {
}

const secondaryActionIcon = () => {
if (state === 'paused') {
if (isPaused) {
return <PlayIcon className="playIcon" />
} else if (state === 'running') {
return <PauseIcon className="pauseIcon" />
Expand Down Expand Up @@ -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')
Expand Down