From 168b7ca548f01d1c2ed346821da41d45fd9c0462 Mon Sep 17 00:00:00 2001 From: Peter Stockings Date: Thu, 26 Jan 2023 21:22:33 +1100 Subject: [PATCH] Add sweetalert to show styled alert on web bluetooth/socket.io errors --- static/js/BLE.js | 4 +++- templates/base.html | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/static/js/BLE.js b/static/js/BLE.js index 2f580e2..e5f7a32 100644 --- a/static/js/BLE.js +++ b/static/js/BLE.js @@ -115,5 +115,7 @@ function revsToRPM(prevRes, res) { btn.addEventListener("click", () => connect({ onChange: parseCSC, - }).catch(console.error) + }).catch((err) => { + swal("Oops", err, "error"); + }) ); diff --git a/templates/base.html b/templates/base.html index 0fb3d1b..269ccbb 100644 --- a/templates/base.html +++ b/templates/base.html @@ -9,6 +9,7 @@ +