Skip to content

Commit

Permalink
Fix not specifying autoReconnectOnUnexpectedDisconnect issue. (#534)
Browse files Browse the repository at this point in the history
* Fix not specifying autoReconnectOnUnexpectedDisconnect issue.

* Format code.

* Use Mapper method to get parameter.

* Set optional for autoReconnectOnUnexpectedDisconnect .
  • Loading branch information
EricLin-BBpos authored Aug 29, 2023
1 parent 9304bd3 commit 0a7770d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ class StripeTerminalReactNativeModule(reactContext: ReactApplicationContext) :
params.getString("locationId") ?: selectedReader.location?.id.orEmpty()

val autoReconnectOnUnexpectedDisconnect = if (discoveryMethod == DiscoveryMethod.BLUETOOTH_SCAN || discoveryMethod == DiscoveryMethod.USB) {
params.getBoolean("autoReconnectOnUnexpectedDisconnect") ?: false
getBoolean(params,"autoReconnectOnUnexpectedDisconnect")
} else false

val reconnectionListener = RNReaderReconnectionListener(context) {
Expand Down
4 changes: 2 additions & 2 deletions src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ export type GetLocationsParams = {
export type ConnectBluetoothReaderParams = {
reader: Reader.Type;
locationId?: string;
autoReconnectOnUnexpectedDisconnect: boolean;
autoReconnectOnUnexpectedDisconnect?: boolean;
};

export type ConnectUsbReaderParams = {
reader: Reader.Type;
locationId?: string;
autoReconnectOnUnexpectedDisconnect: boolean;
autoReconnectOnUnexpectedDisconnect?: boolean;
};

export type ConnectLocalMobileParams = {
Expand Down

0 comments on commit 0a7770d

Please sign in to comment.