Note widget: add dismiss action

This commit is contained in:
MM20
2023-04-27 18:45:52 +02:00
parent 9f675da337
commit 5211f5bced
7 changed files with 119 additions and 23 deletions
@@ -21,6 +21,7 @@ interface WidgetRepository {
fun set(widgets: List<Widget>, parentId: UUID? = null)
fun exists(type: String): Flow<Boolean>
fun count(type: String): Flow<Int>
suspend fun export(toDir: File)
suspend fun import(fromDir: File)
@@ -85,6 +86,12 @@ internal class WidgetRepositoryImpl(
return dao.exists(type = type)
}
override fun count(type: String): Flow<Int> {
val dao = database.widgetDao()
return dao.count(type = type)
}
override suspend fun export(toDir: File) = withContext(Dispatchers.IO) {
val dao = database.backupDao()