Skip to content
Snippets Groups Projects
Commit 2c5dfd85 authored by Andreas Traczyk's avatar Andreas Traczyk Committed by Sébastien Blin
Browse files

mainview: preload the conversation view

This prevents a bug when loading into the call view before having loaded the conversation view at least once, can prevent the call action bar from displaying.


Gitlab: #1002
Change-Id: I1c9e3debc0341630b3ca104bfbdfa71339918e6b
parent 708e5358
No related branches found
No related tags found
No related merge requests found
...@@ -161,6 +161,7 @@ ApplicationWindow { ...@@ -161,6 +161,7 @@ ApplicationWindow {
// Present the welcome view once the viewCoordinator is setup. // Present the welcome view once the viewCoordinator is setup.
viewCoordinator.initialized.connect(function() { viewCoordinator.initialized.connect(function() {
viewCoordinator.present("WelcomePage") viewCoordinator.present("WelcomePage")
viewCoordinator.preload("ConversationView")
}) })
// Set the viewCoordinator's root item. // Set the viewCoordinator's root item.
viewCoordinator.setRootView(item) viewCoordinator.setRootView(item)
......
...@@ -173,6 +173,13 @@ QtObject { ...@@ -173,6 +173,13 @@ QtObject {
return -1 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 // This function presents the view with the given viewName in the
// specified StackView. Return the view if successful. // specified StackView. Return the view if successful.
function present(viewName, sv=activeStackView) { function present(viewName, sv=activeStackView) {
...@@ -292,6 +299,8 @@ QtObject { ...@@ -292,6 +299,8 @@ QtObject {
// Dismiss by view name. // Dismiss by view name.
function dismiss(viewName) { function dismiss(viewName) {
if (!rootView) return
const depth = activeStackView.depth const depth = activeStackView.depth
for (var i = (depth - 1); i >= 0; i--) { for (var i = (depth - 1); i >= 0; i--) {
const view = activeStackView.get(i, StackView.DontLoad) const view = activeStackView.get(i, StackView.DontLoad)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment