MCPcopy
hub / github.com/janhq/jan / useThreadManagement

Function useThreadManagement

web-app/src/hooks/useThreadManagement.ts:98–116  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

96}))
97
98export const useThreadManagement = () => {
99 const store = useThreadManagementStore()
100
101 // Load projects from service on mount
102 useEffect(() => {
103 const syncProjects = async () => {
104 try {
105 const projectsService = getServiceHub().projects()
106 const projects = await projectsService.getProjects()
107 useThreadManagementStore.setState({ folders: projects })
108 } catch (error) {
109 console.error('Error syncing projects:', error)
110 }
111 }
112 syncProjects()
113 }, [])
114
115 return store
116}

Callers 8

NavMainFunction · 0.90
NavProjectsFunction · 0.90
ProjectPageContentFunction · 0.90
ThreadList.tsxFile · 0.90
AddProjectDialogFunction · 0.90
DeleteProjectDialogFunction · 0.90
getStoreFunction · 0.90

Calls 1

syncProjectsFunction · 0.85

Tested by 1

getStoreFunction · 0.72