mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-14 21:07:04 +05:30
refactor: make PostComments non-nullable
This commit is contained in:
parent
c50790e4f9
commit
39e3d783cd
4 changed files with 14 additions and 9 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright © 2021-2023 Harsh Shandilya.
|
||||
* Copyright © 2021-2024 Harsh Shandilya.
|
||||
* Use of this source code is governed by an MIT-style
|
||||
* license that can be found in the LICENSE file or at
|
||||
* https://opensource.org/licenses/MIT.
|
||||
|
@ -22,7 +22,10 @@ constructor(
|
|||
) {
|
||||
|
||||
suspend fun getSeenComments(postId: String) =
|
||||
withContext(dbDispatcher) { postCommentsQueries.getCommentIds(postId).executeAsOneOrNull() }
|
||||
withContext(dbDispatcher) {
|
||||
postCommentsQueries.getCommentIds(postId).executeAsOneOrNull()
|
||||
?: PostComments(postId = postId, commentIds = emptyList())
|
||||
}
|
||||
|
||||
suspend fun markSeenComments(postId: String, comments: List<Comment>) {
|
||||
withContext(dbDispatcher) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue