mirror of https://github.com/readrops/Readrops.git
Merge branch 'refs/heads/master' into develop
# Conflicts: # db/src/main/java/com/readrops/db/dao/ItemDao.kt
This commit is contained in:
commit
47b40ac0eb
|
@ -33,6 +33,7 @@ import kotlinx.coroutines.flow.first
|
||||||
import kotlinx.coroutines.flow.map
|
import kotlinx.coroutines.flow.map
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import kotlinx.coroutines.runBlocking
|
import kotlinx.coroutines.runBlocking
|
||||||
|
import kotlinx.coroutines.withContext
|
||||||
import org.koin.androidx.compose.KoinAndroidContext
|
import org.koin.androidx.compose.KoinAndroidContext
|
||||||
import org.koin.core.component.KoinComponent
|
import org.koin.core.component.KoinComponent
|
||||||
import org.koin.core.component.get
|
import org.koin.core.component.get
|
||||||
|
@ -102,12 +103,12 @@ class MainActivity : ComponentActivity(), KoinComponent {
|
||||||
override fun onNewIntent(intent: Intent) {
|
override fun onNewIntent(intent: Intent) {
|
||||||
super.onNewIntent(intent)
|
super.onNewIntent(intent)
|
||||||
|
|
||||||
lifecycleScope.launch(Dispatchers.IO) {
|
lifecycleScope.launch {
|
||||||
handleIntent(intent)
|
handleIntent(intent)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private suspend fun handleIntent(intent: Intent) {
|
private suspend fun handleIntent(intent: Intent) = withContext(Dispatchers.IO) {
|
||||||
when {
|
when {
|
||||||
intent.hasExtra(SyncWorker.ACCOUNT_ID_KEY) -> {
|
intent.hasExtra(SyncWorker.ACCOUNT_ID_KEY) -> {
|
||||||
val accountId = intent.getIntExtra(SyncWorker.ACCOUNT_ID_KEY, -1)
|
val accountId = intent.getIntExtra(SyncWorker.ACCOUNT_ID_KEY, -1)
|
||||||
|
|
|
@ -17,7 +17,7 @@ import kotlinx.coroutines.flow.Flow
|
||||||
interface ItemDao : BaseDao<Item> {
|
interface ItemDao : BaseDao<Item> {
|
||||||
|
|
||||||
@Query("Select * From Item Where id = :itemId")
|
@Query("Select * From Item Where id = :itemId")
|
||||||
fun select(itemId: Int): Item
|
suspend fun select(itemId: Int): Item
|
||||||
|
|
||||||
@RawQuery(observedEntities = [Item::class, Feed::class, Folder::class, ItemState::class])
|
@RawQuery(observedEntities = [Item::class, Feed::class, Folder::class, ItemState::class])
|
||||||
fun selectAll(query: SupportSQLiteQuery): PagingSource<Int, ItemWithFeed>
|
fun selectAll(query: SupportSQLiteQuery): PagingSource<Int, ItemWithFeed>
|
||||||
|
|
Loading…
Reference in New Issue