From 56bdef2b312f684e06b2f36ef6e7cfdb201a8cb2 Mon Sep 17 00:00:00 2001 From: Michael Zanetti Date: Tue, 9 Mar 2021 22:52:14 +0100 Subject: [PATCH] Fix visual glitches in OAuth flow --- .../ui/thingconfiguration/SetupWizard.qml | 37 ++++++++++++++----- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/nymea-app/ui/thingconfiguration/SetupWizard.qml b/nymea-app/ui/thingconfiguration/SetupWizard.qml index c2eb1923..a0103243 100644 --- a/nymea-app/ui/thingconfiguration/SetupWizard.qml +++ b/nymea-app/ui/thingconfiguration/SetupWizard.qml @@ -570,23 +570,40 @@ Page { Component.onCompleted: { // 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: ' import QtQuick 2.8; import QtWebView 1.1; - WebView { - id: oAuthWebView - anchors.fill: parent - url: oAuthPage.oAuthUrl + import QtQuick.Controls 2.9 + import Nymea 1.0; - onUrlChanged: { - print("OAUTH URL changed", url) - if (url.toString().indexOf("https://127.0.0.1") == 0) { - print("Redirect URL detected!"); - engine.thingManager.confirmPairing(d.pairingTransactionId, url) + Rectangle { + anchors.fill: parent + color: Style.backgroundColor + + BusyIndicator { + id: busyIndicator + anchors.centerIn: parent + running: oAuthWebView.loading + } + + WebView { + id: oAuthWebView + anchors.fill: parent + url: oAuthPage.oAuthUrl + + onUrlChanged: { + print("OAUTH URL changed", url) + if (url.toString().indexOf("https://127.0.0.1") == 0) { + print("Redirect URL detected!"); + engine.thingManager.confirmPairing(d.pairingTransactionId, url) + busyIndicator.running = true + oAuthWebView.visible = false + } } } }