8
8
InstalledInfo ,
9
9
LibraryTopSectionOptions ,
10
10
RefreshOptions ,
11
- Runner ,
12
11
WineVersionInfo
13
12
} from 'src/types'
14
13
import { TFunction , withTranslation } from 'react-i18next'
@@ -233,13 +232,12 @@ export class GlobalState extends PureComponent<Props> {
233
232
this . setState ( { libraryTopSection : value } )
234
233
}
235
234
236
- handleSuccessfulLogin = ( runner : Runner ) => {
235
+ handleSuccessfulLogin = ( runner : 'epic' | 'gog' ) => {
237
236
this . handleFilter ( 'all' )
238
237
this . handleCategory ( runner )
239
238
this . refreshLibrary ( {
240
239
fullRefresh : true ,
241
- runInBackground : false ,
242
- library : runner
240
+ runInBackground : false
243
241
} )
244
242
}
245
243
@@ -255,7 +253,7 @@ export class GlobalState extends PureComponent<Props> {
255
253
}
256
254
} )
257
255
258
- this . handleSuccessfulLogin ( 'legendery' as Runner )
256
+ this . handleSuccessfulLogin ( 'epic' )
259
257
}
260
258
261
259
return response . status
@@ -291,7 +289,7 @@ export class GlobalState extends PureComponent<Props> {
291
289
window . location . reload ( )
292
290
}
293
291
294
- refresh = async ( library ?: Runner , checkUpdates ?: boolean ) : Promise < void > => {
292
+ refresh = async ( checkUpdates ?: boolean ) : Promise < void > => {
295
293
console . log ( 'refreshing' )
296
294
297
295
let updates = this . state . gameUpdates
@@ -311,7 +309,7 @@ export class GlobalState extends PureComponent<Props> {
311
309
312
310
try {
313
311
updates = checkUpdates
314
- ? await ipcRenderer . invoke ( 'checkGameUpdates' , library )
312
+ ? await ipcRenderer . invoke ( 'checkGameUpdates' )
315
313
: this . state . gameUpdates
316
314
} catch ( error ) {
317
315
ipcRenderer . send ( 'logError' , error )
@@ -340,8 +338,7 @@ export class GlobalState extends PureComponent<Props> {
340
338
refreshLibrary = async ( {
341
339
checkForUpdates,
342
340
fullRefresh,
343
- runInBackground = true ,
344
- library = undefined
341
+ runInBackground = true
345
342
} : RefreshOptions ) : Promise < void > => {
346
343
if ( this . state . refreshing ) return
347
344
@@ -351,11 +348,11 @@ export class GlobalState extends PureComponent<Props> {
351
348
} )
352
349
ipcRenderer . send ( 'logInfo' , 'Refreshing Library' )
353
350
try {
354
- await ipcRenderer . invoke ( 'refreshLibrary' , fullRefresh , library )
351
+ await ipcRenderer . invoke ( 'refreshLibrary' , fullRefresh )
355
352
} catch ( error ) {
356
353
ipcRenderer . send ( 'logError' , error )
357
354
}
358
- this . refresh ( library , checkForUpdates )
355
+ this . refresh ( checkForUpdates )
359
356
}
360
357
361
358
refreshWineVersionInfo = async ( fetch : boolean ) : Promise < void > => {
@@ -410,8 +407,7 @@ export class GlobalState extends PureComponent<Props> {
410
407
appName,
411
408
status,
412
409
folder,
413
- progress,
414
- runner
410
+ progress
415
411
} : GameStatus ) => {
416
412
const { libraryStatus, gameUpdates } = this . state
417
413
const currentApp = libraryStatus . filter (
@@ -444,8 +440,7 @@ export class GlobalState extends PureComponent<Props> {
444
440
// This avoids calling legendary again before the previous process is killed when canceling
445
441
this . refreshLibrary ( {
446
442
checkForUpdates : true ,
447
- runInBackground : true ,
448
- library : runner
443
+ runInBackground : true
449
444
} )
450
445
451
446
storage . setItem (
@@ -459,7 +454,7 @@ export class GlobalState extends PureComponent<Props> {
459
454
} )
460
455
}
461
456
462
- this . refreshLibrary ( { runInBackground : true , library : runner } )
457
+ this . refreshLibrary ( { runInBackground : true } )
463
458
this . setState ( { libraryStatus : newLibraryStatus } )
464
459
}
465
460
}
0 commit comments