Skip to content

Commit 1d25b3e

Browse files
authored
only keep types change
1 parent 99adac6 commit 1d25b3e

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

services/service.ts

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -406,12 +406,17 @@ function runService(): void {
406406
return serviceRemote as Service;
407407
}
408408

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', {});
415420
const appInfo = appList.apps.find((app) => app.id === appId);
416421
if (!appInfo) throw new Error(`Invalid appId, or unsupported application type: ${appId}`);
417422
return appInfo;
@@ -491,7 +496,7 @@ function runService(): void {
491496

492497
try {
493498
const appInfo = await getAppInfo(installedPackageId);
494-
await createToast(`Application installed: ${appInfo['title']}`, service);
499+
await createToast(`Application installed: ${appInfo.title}`, service);
495500
} catch (err: unknown) {
496501
console.warn('appinfo fetch failed:', err);
497502
await createToast(`Application installed: ${installedPackageId}`, service);

0 commit comments

Comments
 (0)