File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -406,12 +406,17 @@ function runService(): void {
406
406
return serviceRemote as Service ;
407
407
}
408
408
409
- async function getAppInfo ( appId : string ) : Promise < Record < string , any > > {
410
- const appList = await asyncCall < { apps : { id : string } [ ] } > (
411
- getInstallerService ( ) ,
412
- 'luna://com.webos.applicationManager/dev/listApps' ,
413
- { } ,
414
- ) ;
409
+ interface AppInfo {
410
+ id : string ;
411
+ title : string ;
412
+ type : string ;
413
+ folderPath : string ;
414
+ }
415
+ interface AppsList {
416
+ apps : AppInfo [ ] ;
417
+ }
418
+ async function getAppInfo ( appId : string ) : Promise < AppInfo > {
419
+ const appList = await asyncCall < AppsList > ( getInstallerService ( ) , 'luna://com.webos.applicationManager/dev/listApps' , { } ) ;
415
420
const appInfo = appList . apps . find ( ( app ) => app . id === appId ) ;
416
421
if ( ! appInfo ) throw new Error ( `Invalid appId, or unsupported application type: ${ appId } ` ) ;
417
422
return appInfo ;
@@ -491,7 +496,7 @@ function runService(): void {
491
496
492
497
try {
493
498
const appInfo = await getAppInfo ( installedPackageId ) ;
494
- await createToast ( `Application installed: ${ appInfo [ ' title' ] } ` , service ) ;
499
+ await createToast ( `Application installed: ${ appInfo . title } ` , service ) ;
495
500
} catch ( err : unknown ) {
496
501
console . warn ( 'appinfo fetch failed:' , err ) ;
497
502
await createToast ( `Application installed: ${ installedPackageId } ` , service ) ;
You can’t perform that action at this time.
0 commit comments