@@ -40,6 +40,7 @@ const DownloadManagerItem = ({ element, current, state }: Props) => {
40
40
const { amazon, epic, gog, showDialogModal } = useContext ( ContextProvider )
41
41
const { t } = useTranslation ( 'gamepage' )
42
42
const { t : t2 } = useTranslation ( 'translation' )
43
+ const isPaused = state && [ 'idle' , 'paused' ] . includes ( state )
43
44
44
45
const navigate = useNavigate ( )
45
46
@@ -125,7 +126,7 @@ const DownloadManagerItem = ({ element, current, state }: Props) => {
125
126
// using one element for the different states so it doesn't
126
127
// lose focus from the button when using a game controller
127
128
const handleSecondaryActionClick = ( ) => {
128
- if ( state === 'paused' ) {
129
+ if ( isPaused ) {
129
130
window . api . resumeCurrentDownload ( )
130
131
} else if ( state === 'running' ) {
131
132
window . api . pauseCurrentDownload ( )
@@ -148,7 +149,7 @@ const DownloadManagerItem = ({ element, current, state }: Props) => {
148
149
}
149
150
150
151
const secondaryActionIcon = ( ) => {
151
- if ( state === 'paused' ) {
152
+ if ( isPaused ) {
152
153
return < PlayIcon className = "playIcon" />
153
154
} else if ( state === 'running' ) {
154
155
return < PauseIcon className = "pauseIcon" />
@@ -179,7 +180,7 @@ const DownloadManagerItem = ({ element, current, state }: Props) => {
179
180
}
180
181
181
182
const secondaryIconTitle = ( ) => {
182
- if ( state === 'paused' ) {
183
+ if ( isPaused ) {
183
184
return t ( 'queue.label.resume' , 'Resume download' )
184
185
} else if ( state === 'running' ) {
185
186
return t ( 'queue.label.pause' , 'Pause download' )
0 commit comments