mirror of
https://github.com/haexhub/haex-hub.git
synced 2025-12-17 06:30:50 +01:00
changed openWindow signature
This commit is contained in:
@ -113,8 +113,8 @@ const openItem = async (item: LauncherItem) => {
|
|||||||
// Check if we're on the desktop page
|
// Check if we're on the desktop page
|
||||||
const isOnDesktop = route.name === 'desktop'
|
const isOnDesktop = route.name === 'desktop'
|
||||||
|
|
||||||
console.log('currentWorkspace', currentWorkspace.value)
|
console.log('currentWorkspace', currentWorkspace.value, route.name)
|
||||||
if (!isOnDesktop) {
|
/* if (!isOnDesktop) {
|
||||||
// Navigate to desktop first
|
// Navigate to desktop first
|
||||||
await router.push(
|
await router.push(
|
||||||
localePath({
|
localePath({
|
||||||
@ -124,15 +124,16 @@ const openItem = async (item: LauncherItem) => {
|
|||||||
|
|
||||||
// Wait for navigation and DOM update
|
// Wait for navigation and DOM update
|
||||||
await nextTick()
|
await nextTick()
|
||||||
}
|
} */
|
||||||
|
|
||||||
// Open the window with correct type and sourceId
|
// Open the window with correct type and sourceId
|
||||||
windowManagerStore.openWindow(
|
windowManagerStore.openWindow({
|
||||||
item.type, // 'system' or 'extension'
|
sourceId: item.id,
|
||||||
item.id, // systemWindowId or extensionId
|
type: item.type, // 'system' or 'extension'
|
||||||
item.name,
|
icon: item.icon, // systemWindowId or extensionId
|
||||||
item.icon,
|
title: item.name,
|
||||||
)
|
workspaceId: currentWorkspace.value?.id,
|
||||||
|
})
|
||||||
|
|
||||||
open.value = false
|
open.value = false
|
||||||
}
|
}
|
||||||
|
|||||||
@ -102,22 +102,45 @@ export const useWindowManagerStore = defineStore('windowManager', () => {
|
|||||||
windowsFrom.value.forEach((window) => (window.workspaceId = toWorkspaceId))
|
windowsFrom.value.forEach((window) => (window.workspaceId = toWorkspaceId))
|
||||||
}
|
}
|
||||||
|
|
||||||
const openWindow = (
|
const openWindow = ({
|
||||||
type: 'system' | 'extension',
|
height,
|
||||||
sourceId: string,
|
icon,
|
||||||
workspaceId: string,
|
sourceId,
|
||||||
title?: string,
|
sourcePosition,
|
||||||
icon?: string,
|
title,
|
||||||
width?: number,
|
type,
|
||||||
height?: number,
|
width,
|
||||||
sourcePosition?: { x: number; y: number; width: number; height: number },
|
workspaceId,
|
||||||
) => {
|
}: {
|
||||||
const workspace = workspaces.value.find((w) => w.id === workspaceId)
|
height?: number
|
||||||
if (!workspace) {
|
icon?: string
|
||||||
|
sourceId: string
|
||||||
|
sourcePosition?: { x: number; y: number; width: number; height: number }
|
||||||
|
title?: string
|
||||||
|
type: 'system' | 'extension'
|
||||||
|
width?: number
|
||||||
|
workspaceId?: string
|
||||||
|
}) => {
|
||||||
|
// Wenn kein workspaceId angegeben ist, nutze die current workspace
|
||||||
|
const targetWorkspaceId = workspaceId || currentWorkspace.value?.id
|
||||||
|
|
||||||
|
if (!targetWorkspaceId) {
|
||||||
console.error('Cannot open window: No active workspace')
|
console.error('Cannot open window: No active workspace')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Sicherheitscheck
|
||||||
|
if (!targetWorkspaceId) {
|
||||||
|
console.error('Cannot open window: No workspace available')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const workspace = workspaces.value?.find((w) => w.id === targetWorkspaceId)
|
||||||
|
if (!workspace) {
|
||||||
|
console.error('Cannot open window: Invalid workspace')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// System Window specific handling
|
// System Window specific handling
|
||||||
if (type === 'system') {
|
if (type === 'system') {
|
||||||
const systemWindowDef = getSystemWindow(sourceId)
|
const systemWindowDef = getSystemWindow(sourceId)
|
||||||
|
|||||||
Reference in New Issue
Block a user