Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove shared image information once it's been inserted in the Post #9427

Merged
merged 2 commits into from
Mar 18, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2415,12 +2415,14 @@ private void fillContentEditorFields() {
mEditorFragment.setFeaturedImageId(mPost.getFeaturedImageId());
}

// Special actions
String action = getIntent().getAction();
if (Intent.ACTION_SEND.equals(action) || Intent.ACTION_SEND_MULTIPLE.equals(action)) {
setPostContentFromShareAction();
} else if (NEW_MEDIA_POST.equals(action)) {
prepareMediaPost();
// Special actions - these only make sense for empty posts that are going to be populated now
if (!mHasSetPostContent) {
String action = getIntent().getAction();
if (Intent.ACTION_SEND.equals(action) || Intent.ACTION_SEND_MULTIPLE.equals(action)) {
setPostContentFromShareAction();
} else if (NEW_MEDIA_POST.equals(action)) {
prepareMediaPost();
}
}
}

Expand Down Expand Up @@ -2474,11 +2476,13 @@ protected void setPostContentFromShareAction() {
sharedUris = new ArrayList<Uri>();
sharedUris.add((Uri) intent.getParcelableExtra(Intent.EXTRA_STREAM));
} else {
return;
sharedUris = null;
}
}

if (sharedUris != null) {
// removing this from the intent so it doesn't insert the media items again on each Acivity re-creation
getIntent().removeExtra(Intent.EXTRA_STREAM);
addMediaList(sharedUris, false);
}
}
Expand Down