Properly clear messages from database
This commit is contained in:
parent
67e9b4587b
commit
4582bc5289
4 changed files with 12 additions and 8 deletions
|
|
@ -989,12 +989,15 @@ fun Context.getFileSizeFromUri(uri: Uri): Long {
|
|||
// fix a glitch at enabling Release version minifying from 5.12.3
|
||||
// reset messages in 5.14.3 again, as PhoneNumber is no longer minified
|
||||
// reset messages in 5.19.1 again, as SimpleContact is no longer minified
|
||||
fun Context.clearAllMessagesIfNeeded() {
|
||||
fun Context.clearAllMessagesIfNeeded(callback: () -> Unit) {
|
||||
if (!config.wasDbCleared) {
|
||||
ensureBackgroundThread {
|
||||
messagesDB.deleteAll()
|
||||
config.wasDbCleared = true
|
||||
callback()
|
||||
}
|
||||
config.wasDbCleared = true
|
||||
} else {
|
||||
callback()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue