Skip to content

Commit

Permalink
Merge pull request #302 from FossifyOrg/access_db_in_background
Browse files Browse the repository at this point in the history
Access db on background thread
  • Loading branch information
naveensingh authored Feb 2, 2025
2 parents ddc0e8a + 5f6ec81 commit efaa231
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,10 @@ class MmsReceiver : MmsReceivedReceiver() {
threadId = mms.threadId,
bitmap = glideBitmap
)
val conversation = context.getConversations(mms.threadId).firstOrNull() ?: return@post

ensureBackgroundThread {
val conversation = context.getConversations(mms.threadId).firstOrNull()
?: return@ensureBackgroundThread
context.insertOrUpdateConversation(conversation)
context.updateUnreadCountBadge(context.conversationsDB.getUnreadConversations())
refreshMessages()
Expand Down

0 comments on commit efaa231

Please sign in to comment.