From 3b9c82af3d81f4446f82ed076c5c8c44b1bdfe90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=B2=A9=E5=B2=A9?= Date: Thu, 23 Jul 2026 14:19:37 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20App=20Store=20=E6=9C=AA=E6=89=93?= =?UTF-8?q?=E5=BC=80=E6=97=B6=20=5FAppStoreApp=3Dnull=20=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E5=B7=B2=E5=AE=89=E8=A3=85=E5=BA=94=E7=94=A8=E5=BC=B9=E7=AA=97?= =?UTF-8?q?'=E5=B0=9A=E6=9C=AA=E5=AE=89=E8=A3=85'=E2=80=94=E2=80=94?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E7=9B=B4=E6=8E=A5=E8=AF=BB=20store?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apps/launchpad/index.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/apps/launchpad/index.ts b/src/apps/launchpad/index.ts index eb10c79..93f820b 100644 --- a/src/apps/launchpad/index.ts +++ b/src/apps/launchpad/index.ts @@ -3,6 +3,7 @@ import { h, render } from 'vue' import { Apps, stdMenus } from '../../composables/useApps' import LaunchpadComponent from './Launchpad.vue' import { ui } from '../../composables/useUI' +import { store } from '../../composables/useStore' let _AppStoreApp: any = null export function setAppStoreForLaunchpad(a: any) { _AppStoreApp = a } @@ -46,7 +47,13 @@ Apps.open = function (id: string, args?: any) { if (id === 'launchpad') { Launchpad.show(); return null } if (id === 'stickies' && !(args && args.noteId)) { (Apps.get('stickies') as any)?.openAll(); return null } const app = this.get(id) - if (app && app.storeApp && !(_AppStoreApp && _AppStoreApp.isInstalled(id))) { + // storeApp 检查:优先通过 _AppStoreApp(App Store 打开后注入), + // 若 _AppStoreApp 为 null(App Store 尚未打开过),直接从 store 读取 + const isStoreApp = app?.storeApp + const installed = isStoreApp + ? (_AppStoreApp ? _AppStoreApp.isInstalled(id) : (store.get('appstore-installed', []) as string[]).includes(id)) + : true + if (app && isStoreApp && !installed) { ui.alert('尚未安装', `请先在 App Store 中获取"${app.name}"。`, '/assets/icons/appstore.png') return null }