Skip to content

Commit

Permalink
chore: recreate native error
Browse files Browse the repository at this point in the history
  • Loading branch information
dimninik authored and gmiszewski-intent committed Oct 10, 2023
1 parent 1d8c26e commit 498bd17
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/**/node_modules/*
node_modules/
docs/**
docs/**
lib/**
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export function DashboardScreen({ navigation }: DashboardScreenProps) {
/>
<AppButton label="Ask for permissions" onPress={BLEService.requestBluetoothPermission} />
<AppButton label="Go to nRF test" onPress={() => navigation.navigate('DEVICE_NRF_TEST_SCREEN')} />
<AppButton label="Call disconnect with wrong id" onPress={() => BLEService.isDeviceWithIdConnected('asd')} />
<FlatList
style={{ flex: 1 }}
data={foundDevices}
Expand Down
6 changes: 3 additions & 3 deletions example/src/services/BLEService/BLEService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,11 +280,11 @@ class BLEServiceInstance {
this.showErrorToast(deviceNotConnectedErrorText)
throw new Error(deviceNotConnectedErrorText)
}
return this.manager.isDeviceConnected(this.device.id).catch(error => {
this.onError(error)
})
return this.manager.isDeviceConnected(this.device.id)
}

isDeviceWithIdConnected = (id: string) => this.manager.isDeviceConnected(id).catch(console.error)

getConnectedDevices = (expectedServices: UUID[]) => {
if (!this.device) {
this.showErrorToast(deviceNotConnectedErrorText)
Expand Down

0 comments on commit 498bd17

Please sign in to comment.