[3.2.0][opt]删除消息盒子历史数据时切换线程
This commit is contained in:
@@ -93,9 +93,19 @@ object DataManager {
|
||||
}
|
||||
|
||||
fun delMsgTable(context: Context) {
|
||||
MsgBoxDb.getDb(context)
|
||||
.monitorDao()
|
||||
.deleteMsgTable()
|
||||
if (Thread.currentThread() == Looper.getMainLooper().thread) {
|
||||
scope.launch {
|
||||
withContext(Dispatchers.Default) {
|
||||
MsgBoxDb.getDb(context)
|
||||
.monitorDao()
|
||||
.deleteMsgTable()
|
||||
}
|
||||
}
|
||||
} else {
|
||||
MsgBoxDb.getDb(context)
|
||||
.monitorDao()
|
||||
.deleteMsgTable()
|
||||
}
|
||||
}
|
||||
|
||||
private fun realSaveMsg(msg: MsgBoxBean) {
|
||||
|
||||
Reference in New Issue
Block a user