mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit is contained in:
parent
81dc625c70
commit
e701ad6aee
12 changed files with 68 additions and 14 deletions
|
|
@ -26,7 +26,7 @@ interface NodeInfoWriteDataSource {
|
|||
|
||||
suspend fun installConfig(mi: MyNodeEntity, nodes: List<NodeEntity>)
|
||||
|
||||
suspend fun clearNodeDB()
|
||||
suspend fun clearNodeDB(preserveFavorites: Boolean)
|
||||
|
||||
suspend fun deleteNode(num: Int)
|
||||
|
||||
|
|
|
|||
|
|
@ -40,8 +40,8 @@ constructor(
|
|||
override suspend fun installConfig(mi: MyNodeEntity, nodes: List<NodeEntity>) =
|
||||
withContext(dispatchers.io) { dbManager.withDb { it.nodeInfoDao().installConfig(mi, nodes) } }
|
||||
|
||||
override suspend fun clearNodeDB() =
|
||||
withContext(dispatchers.io) { dbManager.withDb { it.nodeInfoDao().clearNodeInfo() } }
|
||||
override suspend fun clearNodeDB(preserveFavorites: Boolean) =
|
||||
withContext(dispatchers.io) { dbManager.withDb { it.nodeInfoDao().clearNodeInfo(preserveFavorites) } }
|
||||
|
||||
override suspend fun deleteNode(num: Int) =
|
||||
withContext(dispatchers.io) { dbManager.withDb { it.nodeInfoDao().deleteNode(num) } }
|
||||
|
|
|
|||
|
|
@ -136,7 +136,8 @@ constructor(
|
|||
suspend fun installConfig(mi: MyNodeEntity, nodes: List<NodeEntity>) =
|
||||
withContext(dispatchers.io) { nodeInfoWriteDataSource.installConfig(mi, nodes) }
|
||||
|
||||
suspend fun clearNodeDB() = withContext(dispatchers.io) { nodeInfoWriteDataSource.clearNodeDB() }
|
||||
suspend fun clearNodeDB(preserveFavorites: Boolean = false) =
|
||||
withContext(dispatchers.io) { nodeInfoWriteDataSource.clearNodeDB(preserveFavorites) }
|
||||
|
||||
suspend fun deleteNode(num: Int) = withContext(dispatchers.io) {
|
||||
nodeInfoWriteDataSource.deleteNode(num)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue