mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-15 13:27:03 +05:30
android: add logtags
This commit is contained in:
parent
e93baa84be
commit
7771665562
1 changed files with 3 additions and 2 deletions
|
@ -1,5 +1,6 @@
|
||||||
package dev.msfjarvis.claw.android.viewmodel
|
package dev.msfjarvis.claw.android.viewmodel
|
||||||
|
|
||||||
|
import android.util.Log
|
||||||
import com.squareup.sqldelight.runtime.coroutines.asFlow
|
import com.squareup.sqldelight.runtime.coroutines.asFlow
|
||||||
import com.squareup.sqldelight.runtime.coroutines.mapToList
|
import com.squareup.sqldelight.runtime.coroutines.mapToList
|
||||||
import dev.msfjarvis.claw.database.LobstersDatabase
|
import dev.msfjarvis.claw.database.LobstersDatabase
|
||||||
|
@ -17,12 +18,12 @@ constructor(
|
||||||
val savedPosts = savedPostQueries.selectAllPosts().asFlow().mapToList()
|
val savedPosts = savedPostQueries.selectAllPosts().asFlow().mapToList()
|
||||||
|
|
||||||
suspend fun savePost(post: SavedPost) {
|
suspend fun savePost(post: SavedPost) {
|
||||||
println("Saving post: ${post.shortId}")
|
Log.d("SavedPostsRepository", "Saving post: ${post.shortId}")
|
||||||
withContext(Dispatchers.IO) { savedPostQueries.insertOrReplacePost(post) }
|
withContext(Dispatchers.IO) { savedPostQueries.insertOrReplacePost(post) }
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun removePost(post: SavedPost) {
|
suspend fun removePost(post: SavedPost) {
|
||||||
println("Removing post: ${post.shortId}")
|
Log.d("SavedPostsRepository", "Removing post: ${post.shortId}")
|
||||||
withContext(Dispatchers.IO) { savedPostQueries.deletePost(post.shortId) }
|
withContext(Dispatchers.IO) { savedPostQueries.deletePost(post.shortId) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue