From 77c5ffbb158ddca1b45229e32fff222263886994 Mon Sep 17 00:00:00 2001 From: Rohan Sircar Date: Wed, 27 May 2020 15:02:59 +0530 Subject: [PATCH] FIxed double firing of chat controller --- src/main/scala/wow/doge/chatto/ApplicationController.scala | 3 ++- .../wow/doge/chatto/controller/MainViewController.scala | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/scala/wow/doge/chatto/ApplicationController.scala b/src/main/scala/wow/doge/chatto/ApplicationController.scala index a440874..45a994d 100644 --- a/src/main/scala/wow/doge/chatto/ApplicationController.scala +++ b/src/main/scala/wow/doge/chatto/ApplicationController.scala @@ -95,7 +95,8 @@ class ApplicationController extends DefaultWindowController { } def showChatPane(): Unit = onFX { - replaceSceneContent(mainViewController, true) + replaceSceneContent(mainViewController) + mainViewController.showChatController() } } diff --git a/src/main/scala/wow/doge/chatto/controller/MainViewController.scala b/src/main/scala/wow/doge/chatto/controller/MainViewController.scala index a2a8d29..33788ea 100644 --- a/src/main/scala/wow/doge/chatto/controller/MainViewController.scala +++ b/src/main/scala/wow/doge/chatto/controller/MainViewController.scala @@ -46,8 +46,12 @@ class MainViewController extends ViewController with LazyLogging { // ContentManager(navigationPane, this, navigationController) // statusBarManager = ContentManager(statusPane, this, statusBarController) // workspaceManager = ContentManager(workspacePane, this, workspaceController) - mainManager = ContentManager(mainPane, this, chatController) + mainManager = ContentManager(mainPane, this) chatController.chatMainPane.hgrow = Priority.ALWAYS } + def showChatController(): Unit = { + mainManager.updatePaneContent(chatController) + } + }