Fix visual glitches in OAuth flow

This commit is contained in:
Michael Zanetti 2021-03-09 22:52:14 +01:00
parent bac150106b
commit 56bdef2b31

View File

@ -570,13 +570,27 @@ Page {
Component.onCompleted: { Component.onCompleted: {
// This might fail if qml-module-qtwebview isn't around // This might fail if qml-module-qtwebview isn't around
Qt.createQmlObject(webViewString, webViewContainer); var webView = Qt.createQmlObject(webViewString, webViewContainer);
print("created webView", webView)
} }
property string webViewString: property string webViewString:
' '
import QtQuick 2.8; import QtQuick 2.8;
import QtWebView 1.1; import QtWebView 1.1;
import QtQuick.Controls 2.9
import Nymea 1.0;
Rectangle {
anchors.fill: parent
color: Style.backgroundColor
BusyIndicator {
id: busyIndicator
anchors.centerIn: parent
running: oAuthWebView.loading
}
WebView { WebView {
id: oAuthWebView id: oAuthWebView
anchors.fill: parent anchors.fill: parent
@ -587,6 +601,9 @@ Page {
if (url.toString().indexOf("https://127.0.0.1") == 0) { if (url.toString().indexOf("https://127.0.0.1") == 0) {
print("Redirect URL detected!"); print("Redirect URL detected!");
engine.thingManager.confirmPairing(d.pairingTransactionId, url) engine.thingManager.confirmPairing(d.pairingTransactionId, url)
busyIndicator.running = true
oAuthWebView.visible = false
}
} }
} }
} }