summaryrefslogtreecommitdiffhomepage
path: root/main.mjs
diff options
context:
space:
mode:
Diffstat (limited to 'main.mjs')
-rw-r--r--main.mjs13
1 files changed, 11 insertions, 2 deletions
diff --git a/main.mjs b/main.mjs
index 618efa0..31d4056 100644
--- a/main.mjs
+++ b/main.mjs
@@ -216,5 +216,14 @@ function handleDeviceResponse(event) {
console.log(`Received data from device: ${receivedBytes.join(' ')}`)
}
-const button = document.getElementById('connect')
-button.addEventListener('click', connect)
+function supportBluetoothApi() {
+ return 'bluetooth' in navigator
+}
+
+if (! supportBluetoothApi()) {
+ const unsupportedMessage = document.getElementById('unsupported-message')
+ unsupportedMessage.style.display = 'block'
+
+ const main = document.querySelector('main')
+ main.style.display = 'none'
+}