Skip to content
This repository has been archived by the owner on May 18, 2022. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mackenziekira committed Mar 14, 2022
1 parent 903766c commit 68f43cf
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public class ReceiveSharingIntentModule extends ReactContextBaseJavaModule {

private final ReactApplicationContext reactContext;
private ReceiveSharingIntentHelper receiveSharingIntentHelper;
private Intent oldIntent;

public ReceiveSharingIntentModule(ReactApplicationContext reactContext) {
super(reactContext);
Expand All @@ -30,6 +31,7 @@ public ReceiveSharingIntentModule(ReactApplicationContext reactContext) {
protected void onNewIntent(Intent intent) {
Activity mActivity = getCurrentActivity();
if(mActivity == null) { return; }
oldIntent = mActivity.getIntent();
mActivity.setIntent(intent);
}

Expand All @@ -40,7 +42,9 @@ public void getFileNames(Promise promise){
if(mActivity == null) { return; }
Intent intent = mActivity.getIntent();
receiveSharingIntentHelper.sendFileNames(reactContext, intent, promise);
mActivity.setIntent(null);
if (oldIntent != null) {
mActivity.setIntent(oldIntent);
}
}

@ReactMethod
Expand Down

0 comments on commit 68f43cf

Please sign in to comment.