Skip to content
Snippets Groups Projects
Commit 54093e5c authored by Ming Rui Zhang's avatar Ming Rui Zhang Committed by Andreas Traczyk
Browse files

messagewebview: reload mainview if webengineview does not finish loading js

Gitlab: #134
Change-Id: I0d6406b80ad80cc7278e395bd51d0d7b02538aa0
parent 3e5ee2fb
No related branches found
No related tags found
No related merge requests found
...@@ -177,6 +177,19 @@ Window { ...@@ -177,6 +177,19 @@ Window {
// ConversationSmartListViewItemDelegate provides UI information // ConversationSmartListViewItemDelegate provides UI information
function setMainView(currentUserDisplayName, currentUserAlias, currentUID, function setMainView(currentUserDisplayName, currentUserAlias, currentUID,
callStackViewShouldShow, isAudioOnly, callState) { callStackViewShouldShow, isAudioOnly, callState) {
if (!(communicationPageMessageWebView.jsLoaded)) {
communicationPageMessageWebView.jsLoadedChanged.connect(
function(currentUserDisplayName, currentUserAlias, currentUID,
callStackViewShouldShow, isAudioOnly, callState) {
return function() {
setMainView(currentUserDisplayName, currentUserAlias, currentUID,
callStackViewShouldShow, isAudioOnly, callState)
}
}(currentUserDisplayName, currentUserAlias, currentUID,
callStackViewShouldShow, isAudioOnly, callState))
return
}
if (callStackViewShouldShow) { if (callStackViewShouldShow) {
if (inSettingsView) { if (inSettingsView) {
toggleSettingsView() toggleSettingsView()
......
...@@ -32,6 +32,7 @@ Rectangle { ...@@ -32,6 +32,7 @@ Rectangle {
property int messageWebViewHeaderPreferredHeight: 64 property int messageWebViewHeaderPreferredHeight: 64
property string headerUserAliasLabelText: "" property string headerUserAliasLabelText: ""
property string headerUserUserNameLabelText: "" property string headerUserUserNameLabelText: ""
property bool jsLoaded: false
signal needToHideConversationInCall signal needToHideConversationInCall
...@@ -256,7 +257,8 @@ Rectangle { ...@@ -256,7 +257,8 @@ Rectangle {
messageWebView.runJavaScript(UtilsAdapter.qStringFromFile( messageWebView.runJavaScript(UtilsAdapter.qStringFromFile(
":/qwebchannel.js")) ":/qwebchannel.js"))
messageWebView.runJavaScript(UtilsAdapter.qStringFromFile( messageWebView.runJavaScript(UtilsAdapter.qStringFromFile(
":/chatview.js")) ":/chatview.js"),
function(){jsLoaded = true})
messageWebView.runJavaScript("init_i18n();") messageWebView.runJavaScript("init_i18n();")
messageWebView.runJavaScript("displayNavbar(false);") messageWebView.runJavaScript("displayNavbar(false);")
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment