1
0
Fork 0
mirror of https://git.jami.net/savoirfairelinux/jami-client-qt.git synced 2025-09-10 03:53:23 +02:00

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
This commit is contained in:
Andreas Traczyk 2023-02-24 19:38:00 -05:00 committed by Sébastien Blin
parent 708e53589e
commit 2c5dfd85d5
2 changed files with 10 additions and 0 deletions

View file

@ -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)

View file

@ -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)