Revert "No more main thread SQL"
This reverts commit 4de891b459.
Async writes are a bad idea.
This commit is contained in:
@@ -140,9 +140,7 @@ class ClientsFragment : Fragment(), MainScope by MainScope.Supervisor() {
|
||||
val wasWorking = TrafficRecorder.isWorking(client.mac)
|
||||
client.obtainRecord().apply {
|
||||
blocked = !blocked
|
||||
GlobalScope.launch(Dispatchers.Main, CoroutineStart.UNDISPATCHED) {
|
||||
AppDatabase.instance.clientRecordDao.update(this@apply)
|
||||
}
|
||||
AppDatabase.instance.clientRecordDao.update(this)
|
||||
}
|
||||
IpNeighbourMonitor.instance?.flush()
|
||||
if (!wasWorking && item.itemId == R.id.block) {
|
||||
|
||||
Reference in New Issue
Block a user