mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-24 15:11:03 +00:00
Keep manually saved drafts
This commit is contained in:
parent
9638373cd8
commit
aef77916b7
1 changed files with 10 additions and 1 deletions
|
@ -252,6 +252,7 @@ public class FragmentCompose extends FragmentBase {
|
||||||
private State state = State.NONE;
|
private State state = State.NONE;
|
||||||
private boolean show_images = false;
|
private boolean show_images = false;
|
||||||
private int last_available = 0; // attachments
|
private int last_available = 0; // attachments
|
||||||
|
private boolean saved = false;
|
||||||
|
|
||||||
private Uri photoURI = null;
|
private Uri photoURI = null;
|
||||||
|
|
||||||
|
@ -665,6 +666,10 @@ public class FragmentCompose extends FragmentBase {
|
||||||
case R.id.action_send:
|
case R.id.action_send:
|
||||||
onAction(R.id.action_check, "check");
|
onAction(R.id.action_check, "check");
|
||||||
break;
|
break;
|
||||||
|
case R.id.action_save:
|
||||||
|
saved = true;
|
||||||
|
onAction(action, "save");
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
onAction(action, "navigation");
|
onAction(action, "navigation");
|
||||||
}
|
}
|
||||||
|
@ -2755,7 +2760,7 @@ public class FragmentCompose extends FragmentBase {
|
||||||
private void onExit() {
|
private void onExit() {
|
||||||
if (state == State.LOADED) {
|
if (state == State.LOADED) {
|
||||||
state = State.NONE;
|
state = State.NONE;
|
||||||
if (isEmpty())
|
if (!saved && isEmpty())
|
||||||
onAction(R.id.action_delete, "empty");
|
onAction(R.id.action_delete, "empty");
|
||||||
else {
|
else {
|
||||||
Bundle extras = new Bundle();
|
Bundle extras = new Bundle();
|
||||||
|
@ -3659,6 +3664,8 @@ public class FragmentCompose extends FragmentBase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
args.putBoolean("saved", true);
|
||||||
|
|
||||||
if (data.draft.revision == null) {
|
if (data.draft.revision == null) {
|
||||||
data.draft.revision = 1;
|
data.draft.revision = 1;
|
||||||
data.draft.revisions = 1;
|
data.draft.revisions = 1;
|
||||||
|
@ -3737,6 +3744,8 @@ public class FragmentCompose extends FragmentBase {
|
||||||
encrypt = data.draft.ui_encrypt;
|
encrypt = data.draft.ui_encrypt;
|
||||||
getActivity().invalidateOptionsMenu();
|
getActivity().invalidateOptionsMenu();
|
||||||
|
|
||||||
|
saved = args.getBoolean("saved");
|
||||||
|
|
||||||
// Show identities
|
// Show identities
|
||||||
AdapterIdentitySelect iadapter = new AdapterIdentitySelect(getContext(), data.identities);
|
AdapterIdentitySelect iadapter = new AdapterIdentitySelect(getContext(), data.identities);
|
||||||
spIdentity.setAdapter(iadapter);
|
spIdentity.setAdapter(iadapter);
|
||||||
|
|
Loading…
Reference in a new issue