Merge pull request #776 from naveensingh/fix_threading_crash
Execute `clearAllMessagesIfNeeded` callback on the main thread
This commit is contained in:
commit
96749ac330
|
@ -1038,7 +1038,7 @@ fun Context.clearAllMessagesIfNeeded(callback: () -> Unit) {
|
||||||
ensureBackgroundThread {
|
ensureBackgroundThread {
|
||||||
messagesDB.deleteAll()
|
messagesDB.deleteAll()
|
||||||
config.wasDbCleared = true
|
config.wasDbCleared = true
|
||||||
callback()
|
Handler(Looper.getMainLooper()).post(callback)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
callback()
|
callback()
|
||||||
|
|
Loading…
Reference in New Issue