From fb927c976397d57d45a8bff6008fa8b356ac8583 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Thu, 23 Jul 2020 12:57:26 +0200 Subject: [PATCH] [localeq] Use network-connected property to direct map-loading --- src/modules/localeq/localeq.qml | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/src/modules/localeq/localeq.qml b/src/modules/localeq/localeq.qml index ffd87f5b5..df82b1f9b 100644 --- a/src/modules/localeq/localeq.qml +++ b/src/modules/localeq/localeq.qml @@ -31,41 +31,13 @@ Page { property var confLang: "American English" property var confLocale: "Nederland" - //Needs to come from .conf/geoip - property var hasInternet: true - - function getInt(format) { - var requestURL = "https://example.org/"; - var xhr = new XMLHttpRequest; - - xhr.onreadystatechange = function() { - if (xhr.readyState === XMLHttpRequest.DONE) { - - if (xhr.status !== 200) { - console.log("Disconnected!!"); - var connected = false - hasInternet = connected - return; - } - - else { - console.log("Connected!!"); - } - } - } - xhr.open("GET", requestURL, true); - xhr.send(); - } - Component.onCompleted: { - getInt(); - } Loader { id: image anchors.horizontalCenter: parent.horizontalCenter width: parent.width height: parent.height / 1.28 - source: (hasInternet) ? "Map.qml" : "Offline.qml" + source: (Network.hasInternet) ? "Map.qml" : "Offline.qml" } RowLayout {