Browse Source

Merge pull request #490 from danditomaso/issue-489-bluetooth-uuid-not-set

fix: restored correct BLE service uuid to BLE devices filter
pull/511/head
Dan Ditomaso 1 year ago
committed by GitHub
parent
commit
d39c5ed079
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 4
      src/components/PageComponents/Connect/BLE.tsx
  2. 19
      vercel.json
  3. 6
      vite.config.ts

4
src/components/PageComponents/Connect/BLE.tsx

@ -5,7 +5,7 @@ import { useAppStore } from "@core/stores/appStore.ts";
import { useDeviceStore } from "@core/stores/deviceStore.ts";
import { subscribeAll } from "@core/subscriptions.ts";
import { randId } from "@core/utils/randId.ts";
import { BleConnection, Constants } from "@meshtastic/js";
import { BleConnection, ServiceUuid } from "@meshtastic/js";
import { useCallback, useEffect, useState } from "react";
export const BLE = ({ closeDialog }: TabElementProps) => {
@ -58,7 +58,7 @@ export const BLE = ({ closeDialog }: TabElementProps) => {
onClick={async () => {
await navigator.bluetooth
.requestDevice({
filters: [{ services: [Constants.ServiceUuid] }],
filters: [{ services: [ServiceUuid] }],
})
.then((device) => {
const exists = bleDevices.findIndex((d) => d.id === device.id);

19
vercel.json

@ -1 +1,18 @@
{ "github": { "silent": true } }
{
"github": { "silent": true },
"headers": [
{
"source": "/",
"headers": [
{
"key": "Cross-Origin-Embedder-Policy",
"value": "require-corp"
},
{
"key": "Cross-Origin-Opener-Policy",
"value": "same-origin"
}
]
}
]
}

6
vite.config.ts

@ -41,7 +41,11 @@ export default defineConfig({
},
},
server: {
port: 3000
port: 3000,
headers: {
'Cross-Origin-Opener-Policy': 'same-origin',
'Cross-Origin-Embedder-Policy': 'require-corp',
}
},
optimizeDeps: {
exclude: ['react-scan']

Loading…
Cancel
Save