LCOV - code coverage report
Current view: top level - src/platform/workspace/composables - useWorkspaceSwitch.ts Coverage Total Hit
Test: ComfyUI E2E Coverage Lines: 81.8 % 11 9
Test Date: 2026-11-17 04:17:53

            Line data    Source code
       1              : import { storeToRefs } from 'pinia'
       2              : 
       3              : import { useTeamWorkspaceStore } from '@/platform/workspace/stores/teamWorkspaceStore'
       4              : 
       5            2 : export function useWorkspaceSwitch() {
       6            2 :   const workspaceStore = useTeamWorkspaceStore()
       7            2 :   const { activeWorkspace } = storeToRefs(workspaceStore)
       8              : 
       9            2 :   async function switchWorkspace(workspaceId: string): Promise<boolean> {
      10            2 :     if (activeWorkspace.value?.id === workspaceId) {
      11            0 :       return true
      12              :     }
      13              : 
      14            2 :     try {
      15            2 :       await workspaceStore.switchWorkspace(workspaceId)
      16            2 :       return true
      17              :     } catch {
      18            0 :       return false
      19              :     }
      20              :   }
      21              : 
      22            2 :   return {
      23              :     switchWorkspace
      24              :   }
      25              : }
        

Generated by: LCOV version 2.0-1