Skip to content

Commit

Permalink
updated dependencies and added cancellation method (npomfret#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
perunt authored Sep 1, 2022
1 parent e7e3111 commit 6242405
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ allprojects {
}

dependencies {
provided 'com.google.android.gms:play-services-drive:17.0.0'
implementation 'com.google.android.gms:play-services-drive:17.0.0'
implementation ('com.google.android.gms:play-services-auth:17.0.0') {
force = true;
}
Expand All @@ -53,5 +53,5 @@ dependencies {
implementation('com.google.apis:google-api-services-drive:v3-rev136-1.25.0') {
exclude group: 'org.apache.httpcomponents'
}
provided 'com.facebook.react:react-native:+'
implementation 'com.facebook.react:react-native:+'
}
9 changes: 9 additions & 0 deletions android/src/main/java/org/rncloudfs/RNCloudFsModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,12 @@ public void onActivityResult(Activity activity, int requestCode, int resultCode,
}
});
}
} else if (resultCode == Activity.RESULT_CANCELED && mPendingPromise != null) {
mPendingPromise.reject("canceled", "User canceled");
} else if (mPendingPromise != null) {
mPendingPromise.reject("unknown error", "Operation failed: " + mPendingOperation + " result code " + resultCode);
}
break;
}

}
Expand Down Expand Up @@ -448,6 +453,10 @@ private void handleSignInResult(Task<GoogleSignInAccount> completedTask) {
// The ApiException status code indicates the detailed failure reason.
// Please refer to the GoogleSignInStatusCodes class reference for more information.
Log.w(TAG, "signInResult:failed code=" + e.getStatusCode());
if(this.signInPromise != null){
this.signInPromise.reject("signInResult:" + e.getStatusCode(), e.getMessage());
this.signInPromise = null;
}
}
}

Expand Down

0 comments on commit 6242405

Please sign in to comment.