mirror of
https://github.com/M66B/FairEmail.git
synced 2026-01-03 03:19:24 +01:00
Fixes and improvements
- Last loaders/executors have been gone - Improved debug info - Fixed multiple draft saves
This commit is contained in:
@@ -239,7 +239,7 @@ public class FragmentCompose extends FragmentEx {
|
||||
LinearLayoutManager llm = new LinearLayoutManager(getContext());
|
||||
rvAttachment.setLayoutManager(llm);
|
||||
|
||||
adapter = new AdapterAttachment(getContext());
|
||||
adapter = new AdapterAttachment(getContext(), getViewLifecycleOwner());
|
||||
rvAttachment.setAdapter(adapter);
|
||||
|
||||
return view;
|
||||
@@ -757,36 +757,40 @@ public class FragmentCompose extends FragmentEx {
|
||||
EntityOperation.queue(db, draft, EntityOperation.MOVE, trash.id);
|
||||
|
||||
} else if (action == R.id.action_save) {
|
||||
// Save message ID
|
||||
String msgid = draft.msgid;
|
||||
if (draft.uid == null)
|
||||
db.message().updateMessage(draft);
|
||||
else {
|
||||
// Save message ID
|
||||
String msgid = draft.msgid;
|
||||
|
||||
// Save attachments
|
||||
List<EntityAttachment> attachments = db.attachment().getAttachments(draft.id);
|
||||
for (EntityAttachment attachment : attachments)
|
||||
attachment.content = db.attachment().getContent(attachment.id);
|
||||
// Save attachments
|
||||
List<EntityAttachment> attachments = db.attachment().getAttachments(draft.id);
|
||||
for (EntityAttachment attachment : attachments)
|
||||
attachment.content = db.attachment().getContent(attachment.id);
|
||||
|
||||
// Delete previous draft
|
||||
draft.msgid = null;
|
||||
draft.ui_hide = true;
|
||||
db.message().updateMessage(draft);
|
||||
// Delete previous draft
|
||||
draft.msgid = null;
|
||||
draft.ui_hide = true;
|
||||
db.message().updateMessage(draft);
|
||||
|
||||
EntityOperation.queue(db, draft, EntityOperation.DELETE);
|
||||
EntityOperation.queue(db, draft, EntityOperation.DELETE);
|
||||
|
||||
// Create new draft
|
||||
draft.id = null;
|
||||
draft.uid = null;
|
||||
draft.msgid = msgid;
|
||||
draft.ui_hide = false;
|
||||
draft.id = db.message().insertMessage(draft);
|
||||
// Create new draft
|
||||
draft.id = null;
|
||||
draft.uid = null;
|
||||
draft.msgid = msgid;
|
||||
draft.ui_hide = false;
|
||||
draft.id = db.message().insertMessage(draft);
|
||||
|
||||
// Restore attachments
|
||||
for (EntityAttachment attachment : attachments) {
|
||||
attachment.message = draft.id;
|
||||
db.attachment().insertAttachment(attachment);
|
||||
// Restore attachments
|
||||
for (EntityAttachment attachment : attachments) {
|
||||
attachment.message = draft.id;
|
||||
db.attachment().insertAttachment(attachment);
|
||||
}
|
||||
|
||||
EntityOperation.queue(db, draft, EntityOperation.ADD);
|
||||
}
|
||||
|
||||
EntityOperation.queue(db, draft, EntityOperation.ADD);
|
||||
|
||||
} else if (action == R.id.action_send) {
|
||||
// Check data
|
||||
if (draft.identity == null)
|
||||
|
||||
Reference in New Issue
Block a user