From 9231ea14466fb23baf121fbd81ea503041a465c2 Mon Sep 17 00:00:00 2001 From: sk Date: Thu, 29 Dec 2022 20:12:08 +0100 Subject: [PATCH] offer to save when scheduledAt changed closes sk22#218 --- .../org/joinmastodon/android/fragments/ComposeFragment.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/ComposeFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/ComposeFragment.java index a2a9446b2..b71098954 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/ComposeFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/ComposeFragment.java @@ -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))