Skip to content

Commit

Permalink
Init SignatureAdapter only when needed
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinBoulongne committed May 1, 2024
1 parent f0f80a4 commit 8f5b285
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class NewMessageFragment : Fragment() {
private var quoteWebView: WebView? = null
private var signatureWebView: WebView? = null

private var signatureAdapter: SignatureAdapter? = SignatureAdapter(::onSignatureClicked)
private var signatureAdapter: SignatureAdapter? = null
private val attachmentAdapter inline get() = binding.attachmentsRecyclerView.adapter as AttachmentAdapter

private val newMessageActivity by lazy { requireActivity() as NewMessageActivity }
Expand Down Expand Up @@ -376,7 +376,7 @@ class NewMessageFragment : Fragment() {

private fun setupFromField(signatures: List<Signature>) = with(binding) {

signatureAdapter?.setList(signatures)
signatureAdapter = SignatureAdapter(::onSignatureClicked).also { it.setList(signatures) }

fromMailAddress.post {
runCatching {
Expand Down

0 comments on commit 8f5b285

Please sign in to comment.