From 597419be47844eaaaa1e4ec9376b04fa2bfbccb4 Mon Sep 17 00:00:00 2001 From: David Lechner Date: Wed, 16 Nov 2022 11:57:43 -0600 Subject: [PATCH] ble/alerts/BluetoothNotAvailable: add browser support paragraph Browsers such as Brave and Opera are based on Chromium but disable Web Bluetooth. In this case, we can't tell the difference between the browser not supporting it or the Bluetooth adapter not being present. So we make the error message cover all possibilities. Issue: https://github.com/pybricks/support/discussions/804 Issue: https://github.com/pybricks/support/issues/635 --- src/ble/alerts/BluetoothNotAvailable.tsx | 1 + src/ble/alerts/translations/en.json | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ble/alerts/BluetoothNotAvailable.tsx b/src/ble/alerts/BluetoothNotAvailable.tsx index 08ccd815..89591513 100644 --- a/src/ble/alerts/BluetoothNotAvailable.tsx +++ b/src/ble/alerts/BluetoothNotAvailable.tsx @@ -12,6 +12,7 @@ const BluetoothNotAvailable: React.VoidFunctionComponent = () => { <>

{i18n.translate('bluetoothNotAvailable.message')}

{i18n.translate('bluetoothNotAvailable.suggestion')}

+

{i18n.translate('bluetoothNotAvailable.browserSupport')}

); }; diff --git a/src/ble/alerts/translations/en.json b/src/ble/alerts/translations/en.json index fe9bfd18..76f7cef6 100644 --- a/src/ble/alerts/translations/en.json +++ b/src/ble/alerts/translations/en.json @@ -7,7 +7,8 @@ }, "bluetoothNotAvailable": { "message": "No Bluetooth adapter could be found.", - "suggestion": "Please connect or enable a Bluetooth Low Energy adapter and restart the browser." + "suggestion": "Please connect or enable a Bluetooth Low Energy adapter and restart the browser.", + "browserSupport": "Some browsers like Brave and Opera do not support Web Bluetooth. Be sure to use a supported browser such as Chrome or Edge." }, "noGatt": { "message": "The web browser did not give permission to use Bluetooth Low Energy."