Visibly report connection errors with a link to more info

master
Gordon Williams 2025-03-27 09:14:14 +00:00
parent 873bee0f3d
commit 83b6254218
2 changed files with 11 additions and 2 deletions

View File

@ -236,7 +236,6 @@ window.addEventListener('load', (event) => {
});
});
// Button to install all default apps in one go
el = document.getElementById("installdefault");
if (el) el.addEventListener("click", event=>{
@ -333,6 +332,16 @@ window.addEventListener('load', (event) => {
});
reloadLanguage();
});
if (!navigator.bluetooth) {
console.warn("No Web Bluetooth on this platform");
var iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
if (iOS) {
showToast(`iOS doesn't natively support Web Bluetooth. To use Web Bluetooth on iOS you'll need to <a href="https://itunes.apple.com/us/app/webble/id1193531073">download the WebBLE App</a>`, "error", 1000000000);
} else {
showToast(`This Web Browser doesn't support Web Bluetooth.\nPlease <a href="https://www.espruino.com/Quick+Start+BLE#with-web-bluetooth">click here to see instructions for enabling it</a>`, "error", 1000000000);
}
}
});
function onAppJSONLoaded() {

@ -1 +1 @@
Subproject commit 27939deca30abe8896a4e630e732e5cf4f9a3712
Subproject commit 3019186bf1174b09cd61c2c4fb050e4fddb566f3