rework
parent
6957a0f04b
commit
f844ac623a
5
qr.js
5
qr.js
|
|
@ -1,11 +1,12 @@
|
|||
console.log("qr reader");
|
||||
|
||||
|
||||
sessionStorage.setItem("fromQr", "1");
|
||||
|
||||
function onScanSuccess(qrMessage) {
|
||||
apiKeyInput.value = qrMessage;
|
||||
sessionStorage.setItem = ("apiKeyInput", qrMessage);
|
||||
console.log(`QR = ${qrMessage}`);
|
||||
html5QrcodeScanner.clear();
|
||||
window.location.replace("trigger.html");
|
||||
}
|
||||
|
||||
function onScanFailure(qrMessage) {
|
||||
|
|
|
|||
11
script.js
11
script.js
|
|
@ -67,7 +67,7 @@
|
|||
}
|
||||
|
||||
const setSettings = () => {
|
||||
if (localStorage.getItem("apiKey") && localStorage.getItem("deviceID")) {
|
||||
if (localStorage.getItem("apiKey") && localStorage.getItem("deviceID") && sessionStorage.getItem("fromQr") !== "1") {
|
||||
apiKey = localStorage.getItem("apiKey");
|
||||
deviceID = localStorage.getItem("deviceID");
|
||||
if (localStorage.getItem("delay")) {
|
||||
|
|
@ -80,6 +80,11 @@
|
|||
delayInput.value = delay;
|
||||
showDelay.innerHTML = `${delay}s`;
|
||||
} else {
|
||||
if (sessionStorage.getItem("fromQr") === "1" && sessionStorage.getItem("apiKeyInput") ) {
|
||||
sessionStorage.setItem("fromQr", "0");
|
||||
apiKeyInput.value = sessionStorage.getItem("apiKeyInput");
|
||||
}
|
||||
|
||||
gotoSettingScreen();
|
||||
}
|
||||
}
|
||||
|
|
@ -100,10 +105,6 @@
|
|||
|
||||
|
||||
const scanQr = () => {
|
||||
// settingScreen.style.left = "-100%";
|
||||
// mainScreen.style.left = "-100%";
|
||||
// qrScreen.style.left = "0";
|
||||
|
||||
window.location.replace("qr.html");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@
|
|||
<link rel="icon" href="img/favicon.png" type="img/png">
|
||||
<link rel="apple-touch-icon" href="img/icon.png">
|
||||
<script defer src="script.js"></script>
|
||||
<!-- <script defer src="html5-qrcode.min.js"></script> -->
|
||||
<link rel="stylesheet" href="style.css">
|
||||
</head>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue