保存
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import { computed, watch } from 'vue'
|
||||
import type { IDesktopAppIcon } from '@/ui/types/IDesktopAppIcon.ts'
|
||||
import { appRegistry } from '@/apps'
|
||||
import { externalAppDiscovery } from '@/services/ExternalAppDiscovery'
|
||||
|
||||
/**
|
||||
* 动态应用图标管理
|
||||
@@ -31,20 +30,20 @@ export function useDynamicAppIcons() {
|
||||
}
|
||||
|
||||
// 添加外置应用
|
||||
const externalApps = externalAppDiscovery.getDiscoveredApps()
|
||||
for (const app of externalApps) {
|
||||
const x = ((position - 1) % 4) + 1
|
||||
const y = Math.floor((position - 1) / 4) + 1
|
||||
|
||||
icons.push({
|
||||
name: app.manifest.name,
|
||||
icon: app.manifest.icon || '📱', // 默认图标
|
||||
path: app.manifest.id,
|
||||
x,
|
||||
y
|
||||
})
|
||||
position++
|
||||
}
|
||||
// const externalApps = []
|
||||
// for (const app of externalApps) {
|
||||
// const x = ((position - 1) % 4) + 1
|
||||
// const y = Math.floor((position - 1) / 4) + 1
|
||||
//
|
||||
// icons.push({
|
||||
// name: app.manifest.name,
|
||||
// icon: app.manifest.icon || '📱', // 默认图标
|
||||
// path: app.manifest.id,
|
||||
// x,
|
||||
// y
|
||||
// })
|
||||
// position++
|
||||
// }
|
||||
|
||||
// 添加系统状态应用
|
||||
icons.push({
|
||||
@@ -111,12 +110,6 @@ export function useDynamicAppIcons() {
|
||||
const refreshApps = async () => {
|
||||
try {
|
||||
// 只有在系统服务已启动的情况下才刷新
|
||||
if (externalAppDiscovery['hasStarted']) {
|
||||
await externalAppDiscovery.refresh()
|
||||
console.log('[DynamicAppIcons] 应用列表已刷新')
|
||||
} else {
|
||||
console.log('[DynamicAppIcons] 系统服务未启动,跳过刷新')
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('[DynamicAppIcons] 刷新应用列表失败:', error)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user