Skip to content
This repository was archived by the owner on Oct 28, 2024. It is now read-only.

Commit be4b032

Browse files
committed
fix redrafting empty posts
closes #325
1 parent 95cb045 commit be4b032

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/HeaderStatusDisplayItem.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -181,15 +181,16 @@ public Holder(Activity activity, ViewGroup parent){
181181
final Bundle args=new Bundle();
182182
args.putString("account", item.parentFragment.getAccountID());
183183
args.putParcelable("editStatus", Parcels.wrap(item.status));
184-
if (id==R.id.delete_and_redraft) {
184+
boolean redraft = id==R.id.delete_and_redraft;
185+
if (redraft) {
185186
args.putBoolean("redraftStatus", true);
186187
if (item.parentFragment instanceof ThreadFragment thread && !thread.isItemEnabled(item.status.id)) {
187188
// ("enabled" = clickable; opened status is not clickable)
188189
// request navigation to the re-drafted status if status is currently opened
189190
args.putBoolean("navigateToStatus", true);
190191
}
191192
}
192-
if(TextUtils.isEmpty(item.status.content) && TextUtils.isEmpty(item.status.spoilerText)){
193+
if(!redraft && TextUtils.isEmpty(item.status.content) && TextUtils.isEmpty(item.status.spoilerText)){
193194
Nav.go(item.parentFragment.getActivity(), ComposeFragment.class, args);
194195
}else if(item.scheduledStatus!=null){
195196
args.putString("sourceText", item.status.text);
@@ -204,7 +205,7 @@ public Holder(Activity activity, ViewGroup parent){
204205
public void onSuccess(GetStatusSourceText.Response result){
205206
args.putString("sourceText", result.text);
206207
args.putString("sourceSpoiler", result.spoilerText);
207-
if (id==R.id.delete_and_redraft) {
208+
if (redraft) {
208209
UiUtils.confirmDeletePost(item.parentFragment.getActivity(), item.parentFragment.getAccountID(), item.status, s->{
209210
Nav.go(item.parentFragment.getActivity(), ComposeFragment.class, args);
210211
}, true);

0 commit comments

Comments
 (0)