Fix upload attachment

This commit is contained in:
J-Jamet
2021-08-22 12:23:35 +02:00
parent d841c25bd3
commit 5e15f82313

View File

@@ -301,8 +301,9 @@ class EntryEditFragment: DatabaseFragment() {
private fun putAttachment(attachment: EntryAttachmentState,
onPreviewLoaded: ((attachment: EntryAttachmentState) -> Unit)? = null) {
// When only one attachment is allowed
if (!mAllowMultipleAttachments) {
clearAttachments()
if (!mAllowMultipleAttachments
&& attachment.downloadState == AttachmentState.START) {
attachmentsAdapter?.clear()
}
attachmentsContainerView.visibility = View.VISIBLE
attachmentsAdapter?.putItem(attachment)
@@ -315,10 +316,6 @@ class EntryEditFragment: DatabaseFragment() {
attachmentsAdapter?.removeItem(attachment)
}
private fun clearAttachments() {
attachmentsAdapter?.clear()
}
private fun getAttachmentViewPosition(attachment: EntryAttachmentState,
position: (attachment: EntryAttachmentState, Float) -> Unit) {
attachmentsListView.postDelayed({