Skip to content

Commit

Permalink
Merge branch 'bunch_dev' into bunch_dev_6.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jyliang committed Apr 15, 2020
2 parents 7a68665 + 3c09da5 commit 6e9ee60
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/auth/lib/PhoneAuthListener.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default class PhoneAuthListener {
this._promise = null;
this._jsStack = new Error().stack;

this._timeout = timeout || 20;
this._timeout = typeof timeout === 'number' && 0 <= timeout ? timeout : 20;
this._phoneAuthRequestId = REQUEST_ID++;
this._forceResending = forceResend || false;

Expand Down
6 changes: 4 additions & 2 deletions packages/database/ios/RNFBDatabase/RNFBDatabaseCommon.m
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,10 @@ + (void)setDatabaseConfig:(FIRDatabase *)firDatabase
@try {
// Persistence enabled
BOOL *persistenceEnabled = (BOOL *) [preferences getBooleanValue:DATABASE_PERSISTENCE_ENABLED defaultValue:false];
[firDatabase setPersistenceEnabled:(BOOL) persistenceEnabled];

if (firDatabase.persistenceEnabled != (BOOL)persistenceEnabled){
[firDatabase setPersistenceEnabled:(BOOL) persistenceEnabled];
}

// Logging enabled
BOOL *loggingEnabled = (BOOL *) [preferences getBooleanValue:DATABASE_LOGGING_ENABLED defaultValue:false];
[FIRDatabase setLoggingEnabled:(BOOL) loggingEnabled];
Expand Down
41 changes: 35 additions & 6 deletions packages/database/ios/RNFBDatabase/RNFBDatabaseReferenceModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,13 @@ - (dispatch_queue_t)methodQueue {
: (RCTPromiseRejectBlock)reject
) {
FIRDatabase *firDatabase = [RNFBDatabaseCommon getDatabaseForApp:firebaseApp dbURL:dbURL];
FIRDatabaseReference *firDatabaseReference = [RNFBDatabaseCommon getReferenceForDatabase:firDatabase path:path];
FIRDatabaseReference *firDatabaseReference;
@try {
firDatabaseReference = [RNFBDatabaseCommon getReferenceForDatabase:firDatabase path:path];
} @catch (NSException *exception) {
resolve([NSNull null]);
return;
}

[firDatabaseReference setValue:[props valueForKey:@"value"] withCompletionBlock:^(NSError *error, FIRDatabaseReference *ref) {
if (error != nil) {
Expand All @@ -64,7 +70,13 @@ - (dispatch_queue_t)methodQueue {
: (RCTPromiseRejectBlock)reject
) {
FIRDatabase *firDatabase = [RNFBDatabaseCommon getDatabaseForApp:firebaseApp dbURL:dbURL];
FIRDatabaseReference *firDatabaseReference = [RNFBDatabaseCommon getReferenceForDatabase:firDatabase path:path];
FIRDatabaseReference *firDatabaseReference;
@try {
firDatabaseReference = [RNFBDatabaseCommon getReferenceForDatabase:firDatabase path:path];
} @catch (NSException *exception) {
resolve([NSNull null]);
return;
}

[firDatabaseReference updateChildValues:[props valueForKey:@"values"] withCompletionBlock:^(NSError *error, FIRDatabaseReference *ref) {
if (error != nil) {
Expand All @@ -84,7 +96,13 @@ - (dispatch_queue_t)methodQueue {
: (RCTPromiseRejectBlock)reject
) {
FIRDatabase *firDatabase = [RNFBDatabaseCommon getDatabaseForApp:firebaseApp dbURL:dbURL];
FIRDatabaseReference *firDatabaseReference = [RNFBDatabaseCommon getReferenceForDatabase:firDatabase path:path];
FIRDatabaseReference *firDatabaseReference;
@try {
firDatabaseReference = [RNFBDatabaseCommon getReferenceForDatabase:firDatabase path:path];
} @catch (NSException *exception) {
resolve([NSNull null]);
return;
}

[firDatabaseReference setValue:[props valueForKey:@"value"] andPriority:[props valueForKey:@"priority"] withCompletionBlock:^(NSError *error, FIRDatabaseReference *ref) {
if (error != nil) {
Expand All @@ -103,8 +121,13 @@ - (dispatch_queue_t)methodQueue {
: (RCTPromiseRejectBlock)reject
) {
FIRDatabase *firDatabase = [RNFBDatabaseCommon getDatabaseForApp:firebaseApp dbURL:dbURL];
FIRDatabaseReference *firDatabaseReference = [RNFBDatabaseCommon getReferenceForDatabase:firDatabase path:path];

FIRDatabaseReference *firDatabaseReference;
@try {
firDatabaseReference = [RNFBDatabaseCommon getReferenceForDatabase:firDatabase path:path];
} @catch (NSException *exception) {
resolve([NSNull null]);
return;
}
[firDatabaseReference removeValueWithCompletionBlock:^(NSError *error, FIRDatabaseReference *ref) {
if (error != nil) {
[RNFBDatabaseCommon promiseRejectDatabaseException:reject error:error];
Expand All @@ -123,7 +146,13 @@ - (dispatch_queue_t)methodQueue {
: (RCTPromiseRejectBlock)reject
) {
FIRDatabase *firDatabase = [RNFBDatabaseCommon getDatabaseForApp:firebaseApp dbURL:dbURL];
FIRDatabaseReference *firDatabaseReference = [RNFBDatabaseCommon getReferenceForDatabase:firDatabase path:path];
FIRDatabaseReference *firDatabaseReference;
@try {
firDatabaseReference = [RNFBDatabaseCommon getReferenceForDatabase:firDatabase path:path];
} @catch (NSException *exception) {
resolve([NSNull null]);
return;
}

[firDatabaseReference setPriority:[props valueForKey:@"priority"] withCompletionBlock:^(NSError *error, FIRDatabaseReference *ref) {
if (error != nil) {
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 6e9ee60

Please sign in to comment.