diff --git a/www/js/bluetooth/BluetoothScanPage.tsx b/www/js/bluetooth/BluetoothScanPage.tsx index 777aaa95d..40dac9306 100644 --- a/www/js/bluetooth/BluetoothScanPage.tsx +++ b/www/js/bluetooth/BluetoothScanPage.tsx @@ -5,6 +5,7 @@ import gatherBluetoothData from './blueoothScanner'; import { logWarn } from '../plugin/logger'; import BluetoothCard from './BluetoothCard'; import { Appbar, useTheme, Button } from 'react-native-paper'; +// import useBluetoothScan from '../bluetooth/blueoothScanner' /** * The implementation of this scanner page follows the design of @@ -22,7 +23,7 @@ const BluetoothScanPage = ({ ...props }: any) => { // Function to run Bluetooth test and update logs const runBluetoothTest = async () => { try { - const newLogs = await gatherBluetoothData(); + const newLogs = await gatherBluetoothData(t); setLogs(newLogs); } catch (error) { logWarn(error); diff --git a/www/js/bluetooth/blueoothScanner.ts b/www/js/bluetooth/blueoothScanner.ts index efad6aea7..10b36b498 100644 --- a/www/js/bluetooth/blueoothScanner.ts +++ b/www/js/bluetooth/blueoothScanner.ts @@ -1,11 +1,10 @@ -import { logWarn } from '../plugin/logger'; -import { useTranslation } from 'react-i18next'; +import { logWarn, logDebug } from '../plugin/logger'; -export function gatherBluetoothData(): Promise { - const { t } = useTranslation(); +export default function gatherBluetoothData(t): Promise { return new Promise((resolve, reject) => { let logs: string[] = []; + logDebug("Running bluetooth discovery test!"); window['bluetoothSerial'].discoverUnpaired( (devices: Array) => { @@ -26,6 +25,4 @@ export function gatherBluetoothData(): Promise { }, ); }); -} - -export default gatherBluetoothData; +} \ No newline at end of file