Keep manually saved drafts

This commit is contained in:
M66B 2020-06-20 10:07:29 +02:00
parent 9638373cd8
commit aef77916b7
1 changed files with 10 additions and 1 deletions

View File

@ -252,6 +252,7 @@ public class FragmentCompose extends FragmentBase {
private State state = State.NONE;
private boolean show_images = false;
private int last_available = 0; // attachments
private boolean saved = false;
private Uri photoURI = null;
@ -665,6 +666,10 @@ public class FragmentCompose extends FragmentBase {
case R.id.action_send:
onAction(R.id.action_check, "check");
break;
case R.id.action_save:
saved = true;
onAction(action, "save");
break;
default:
onAction(action, "navigation");
}
@ -2755,7 +2760,7 @@ public class FragmentCompose extends FragmentBase {
private void onExit() {
if (state == State.LOADED) {
state = State.NONE;
if (isEmpty())
if (!saved && isEmpty())
onAction(R.id.action_delete, "empty");
else {
Bundle extras = new Bundle();
@ -3659,6 +3664,8 @@ public class FragmentCompose extends FragmentBase {
}
}
} else {
args.putBoolean("saved", true);
if (data.draft.revision == null) {
data.draft.revision = 1;
data.draft.revisions = 1;
@ -3737,6 +3744,8 @@ public class FragmentCompose extends FragmentBase {
encrypt = data.draft.ui_encrypt;
getActivity().invalidateOptionsMenu();
saved = args.getBoolean("saved");
// Show identities
AdapterIdentitySelect iadapter = new AdapterIdentitySelect(getContext(), data.identities);
spIdentity.setAdapter(iadapter);