diff --git a/src/app/MainApplicationWindow.qml b/src/app/MainApplicationWindow.qml index 15f0df80385784eefaf70861a44ba010c2cbf4bb..782b091c9d72a7011cb0f1c93ad0af4123ae7c32 100644 --- a/src/app/MainApplicationWindow.qml +++ b/src/app/MainApplicationWindow.qml @@ -161,6 +161,7 @@ ApplicationWindow { // Present the welcome view once the viewCoordinator is setup. viewCoordinator.initialized.connect(function() { viewCoordinator.present("WelcomePage") + viewCoordinator.preload("ConversationView") }) // Set the viewCoordinator's root item. viewCoordinator.setRootView(item) diff --git a/src/app/ViewCoordinator.qml b/src/app/ViewCoordinator.qml index 03561a6b4da8c1427c3e723c0afeccb17e6d441d..6ea306cc075a04524bb33aae6d6fc8e3d3e20b7c 100644 --- a/src/app/ViewCoordinator.qml +++ b/src/app/ViewCoordinator.qml @@ -173,6 +173,13 @@ QtObject { return -1 } + // Load a view without presenting it. + function preload(viewName) { + if (!viewManager.createView(resources[viewName], null)) { + console.log("Failed to load view: " + viewName) + } + } + // This function presents the view with the given viewName in the // specified StackView. Return the view if successful. function present(viewName, sv=activeStackView) { @@ -292,6 +299,8 @@ QtObject { // Dismiss by view name. function dismiss(viewName) { + if (!rootView) return + const depth = activeStackView.depth for (var i = (depth - 1); i >= 0; i--) { const view = activeStackView.get(i, StackView.DontLoad)