Skip to content

Commit

Permalink
save first page to local database
Browse files Browse the repository at this point in the history
  • Loading branch information
danielyrovas committed Apr 17, 2024
1 parent 5ae7d3d commit 15d7a4b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ class BookmarkDataSourceImpl(db: Database) : BookmarkDataSource {
}

override fun getBookmarks(): Flow<List<Bookmark>> {
return q.getBookmarksWithTags().asFlow().mapToList(Dispatchers.IO).map { list ->
list.map { it.toBookmark() }
return q.getBookmarksWithTags().asFlow().mapToList(Dispatchers.IO)
.map { list ->
list.map { it.toBookmark() }
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import androidx.lifecycle.viewModelScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.asStateFlow
import kotlinx.coroutines.flow.firstOrNull
import kotlinx.coroutines.flow.update
import kotlinx.coroutines.launch
import me.tatarka.inject.annotations.Inject
Expand All @@ -31,7 +30,7 @@ class HomeScreenState(
onRefresh(res)

res.ifOk {
bookmarkSource.insertBookmark(it.first())
bookmarkSource.insertBookmarks(it)
}
}
}
Expand Down

0 comments on commit 15d7a4b

Please sign in to comment.