@@ -27,7 +27,7 @@ class MainCoordinator: SceneCoordinator<MainRoute, MainTransition> {
2727        super. init ( windowController:  . init( ) ,  initialRoute:  . main( . shared) ) 
2828    } 
2929
30-     lazy var  viewModel =  MainViewModel ( appServices:  appServices,  router:  self ,  completeTransition :  sidebarCoordinator . rx . didCompleteTransition ( ) ) 
30+     lazy var  viewModel =  MainViewModel ( appServices:  appServices,  router:  self ) 
3131
3232    override func  prepareTransition( for route:  MainRoute )  ->  MainTransition  { 
3333        switch  route { 
@@ -39,6 +39,7 @@ class MainCoordinator: SceneCoordinator<MainRoute, MainTransition> {
3939            sidebarCoordinator =  SidebarCoordinator ( appServices:  appServices,  delegate:  self ) 
4040            contentCoordinator =  ContentCoordinator ( appServices:  appServices,  delegate:  self ) 
4141            inspectorCoordinator =  InspectorCoordinator ( appServices:  appServices) 
42+             viewModel. completeTransition =  sidebarCoordinator. rx. didCompleteTransition ( ) 
4243            windowController. setupBindings ( for:  viewModel) 
4344            return  . multiple( 
4445                . show( windowController. splitViewController) , 
@@ -55,7 +56,7 @@ class MainCoordinator: SceneCoordinator<MainRoute, MainTransition> {
5556            return  . route( on:  sidebarCoordinator,  to:  . back) 
5657        case  . contentBack: 
5758            return  . route( on:  contentCoordinator,  to:  . back) 
58-         case  . generationOptions( let   sender) : 
59+         case  let   . generationOptions( sender) : 
5960            let  viewController  =  GenerationOptionsViewController ( ) 
6061            let  viewModel  =  GenerationOptionsViewModel ( appServices:  appServices,  router:  self ) 
6162            viewController. setupBindings ( for:  viewModel) 
@@ -77,8 +78,7 @@ class MainCoordinator: SceneCoordinator<MainRoute, MainTransition> {
7778        switch  route { 
7879        case  . main: 
7980            windowController. splitViewController. setupSplitViewItems ( ) 
80-             
81-             break 
81+ 
8282        default : 
8383            break 
8484        } 
@@ -87,17 +87,19 @@ class MainCoordinator: SceneCoordinator<MainRoute, MainTransition> {
8787
8888extension  MainCoordinator :  SidebarCoordinator . Delegate  { 
8989    func  sidebarCoordinator( _ sidebarCoordinator:  SidebarCoordinator ,  completeTransition route:  SidebarRoute )  { 
90+ //        if sidebarCoordinator.rootViewController.viewControllers.count < 2 {
91+ //            windowController.toolbarController.toolbar.removeItem(at: .Main.sidebarBack)
92+ //        } else if !windowController.toolbarController.toolbar.items.contains(where: { $0.itemIdentifier == .Main.sidebarBack }) {
93+ //            windowController.toolbarController.toolbar.insertItem(withItemIdentifier: .Main.sidebarBack, at: 0)
94+ //        }
9095        switch  route { 
91-         case  . selectedNode( _ ) : 
96+         case  . selectedNode: 
9297            break 
9398        case  let  . clickedNode( runtimeNamedNode) : 
9499            windowController. window? . title =  runtimeNamedNode. name
95100        case  let  . selectedObject( runtimeObjectType) : 
96- //            windowController.window?.title = runtimeObjectType.name
97-             
98101            contentCoordinator. contextTrigger ( . root( runtimeObjectType) ) 
99102        case  . back: 
100- //            windowController.window?.title = "Runtime Viewer"
101103            contentCoordinator. contextTrigger ( . placeholder) 
102104        default : 
103105            break 
@@ -115,9 +117,9 @@ extension MainCoordinator: ContentCoordinator.Delegate {
115117        switch  route { 
116118        case  . placeholder: 
117119            inspectorCoordinator. contextTrigger ( . placeholder) 
118-         case  . root( let   runtimeObjectType) : 
120+         case  let   . root( runtimeObjectType) : 
119121            inspectorCoordinator. contextTrigger ( . root( . object( runtimeObjectType) ) ) 
120-         case  . next( let   runtimeObjectType) : 
122+         case  let   . next( runtimeObjectType) : 
121123            inspectorCoordinator. contextTrigger ( . next( . object( runtimeObjectType) ) ) 
122124        case  . back: 
123125            inspectorCoordinator. contextTrigger ( . back) 
0 commit comments