11import "reflect-metadata" ;
2- import { container } from "tsyringe" ;
32import { useEffect , useRef } from "react" ;
43import BounceLoader from "react-spinners/BounceLoader" ;
54
65import MonoLogo from "assets/monoLogo.svg" ;
76import { BranchSelector , Statistics , TemporalFilter , ThemeSelector , VerticalClusterList } from "components" ;
87import "./App.scss" ;
9- import type IDEPort from "ide/IDEPort" ;
108import { useAnalayzedData } from "hooks" ;
119import { RefreshButton } from "components/RefreshButton" ;
1210import type { IDESentEvents } from "types/IDESentEvents" ;
1311import { useBranchStore , useDataStore , useGithubInfo , useLoadingStore , useThemeStore } from "store" ;
1412import { THEME_INFO } from "components/ThemeSelector/ThemeSelector.const" ;
13+ import { initializeIDEConnection } from "services" ;
1514
1615const App = ( ) => {
1716 const initRef = useRef < boolean > ( false ) ;
@@ -21,7 +20,6 @@ const App = () => {
2120 const { handleGithubInfo } = useGithubInfo ( ) ;
2221 const { loading, setLoading } = useLoadingStore ( ) ;
2322 const { theme } = useThemeStore ( ) ;
24- const ideAdapter = container . resolve < IDEPort > ( "IDEAdapter" ) ;
2523
2624 useEffect ( ( ) => {
2725 if ( initRef . current === false ) {
@@ -31,13 +29,10 @@ const App = () => {
3129 handleGithubInfo,
3230 } ;
3331 setLoading ( true ) ;
34- ideAdapter . addIDESentEventListener ( callbacks ) ;
35- ideAdapter . sendFetchAnalyzedDataMessage ( ) ;
36- ideAdapter . sendFetchBranchListMessage ( ) ;
37- ideAdapter . sendFetchGithubInfo ( ) ;
32+ initializeIDEConnection ( callbacks ) ;
3833 initRef . current = true ;
3934 }
40- } , [ handleChangeAnalyzedData , handleChangeBranchList , handleGithubInfo , ideAdapter , setLoading ] ) ;
35+ } , [ handleChangeAnalyzedData , handleChangeBranchList , handleGithubInfo , setLoading ] ) ;
4136
4237 if ( loading ) {
4338 return (
0 commit comments