Skip to content

Commit 9beb319

Browse files
committed
feat(ios): explicitly allow restoreIdentifer = null to disable restoring.
1 parent 1028c15 commit 9beb319

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

src/bluetooth.common.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export function prepareArgs(target: Object, propertyKey: string, descriptor: Typ
7575
}
7676

7777
export interface BluetoothOptions {
78-
restoreIdentifier: string;
78+
restoreIdentifier: string | null;
7979
showPowerAlertPopup: boolean;
8080
disableAndroidQueue: boolean;
8181
}

src/bluetooth.ios.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -700,13 +700,17 @@ export class Bluetooth extends BluetoothCommon {
700700

701701
private restoreIdentifier: string;
702702

703-
constructor(restoreIdentifierOrOptions: string | Partial<BluetoothOptions> = 'ns_bluetooth', private showPowerAlertPopup = false) {
703+
constructor(restoreIdentifierOrOptions: string | Partial<BluetoothOptions> | null = 'ns_bluetooth', private showPowerAlertPopup = false) {
704704
super();
705-
if (typeof restoreIdentifierOrOptions === 'string') {
706-
this.restoreIdentifier = restoreIdentifierOrOptions;
707-
} else if (!!restoreIdentifierOrOptions) {
708-
this.restoreIdentifier = restoreIdentifierOrOptions.restoreIdentifier || 'ns_bluetooth';
705+
if (typeof restoreIdentifierOrOptions === 'object') {
706+
if (restoreIdentifierOrOptions.restoreIdentifier === undefined) {
707+
this.restoreIdentifier = 'ns_bluetooth';
708+
} else {
709+
this.restoreIdentifier = restoreIdentifierOrOptions.restoreIdentifier;
710+
}
709711
this.showPowerAlertPopup = !!restoreIdentifierOrOptions.showPowerAlertPopup;
712+
} else {
713+
this.restoreIdentifier = restoreIdentifierOrOptions;
710714
}
711715

712716
if (Trace.isEnabled()) {

0 commit comments

Comments
 (0)