offer to save when scheduledAt changed

closes sk22#218
This commit is contained in:
sk 2022-12-29 20:12:08 +01:00
parent 624700497b
commit 9231ea1446
1 changed files with 2 additions and 1 deletions

View File

@ -1029,6 +1029,7 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr
if(!existingMediaIDs.equals(attachments.stream().map(a->a.serverAttachment.id).collect(Collectors.toList())))
return true;
if(!statusVisibility.equals(editingStatus.visibility)) return true;
if(scheduledStatus != null && !scheduledStatus.scheduledAt.equals(scheduledAt)) return true;
return pollChanged;
}
boolean pollFieldsHaveContent=false;
@ -1080,7 +1081,7 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr
new M3AlertDialogBuilder(getActivity())
.setTitle(editingStatus != null ? R.string.sk_save_changes : R.string.sk_save_draft)
.setPositiveButton(R.string.save, (d, w) -> {
updateScheduledAt(getDraftInstant());
updateScheduledAt(scheduledAt == null ? getDraftInstant() : scheduledAt);
publish();
})
.setNegativeButton(R.string.discard, (d, w) -> Nav.finish(this))