Inserting items in the DB.
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing

This commit is contained in:
aminecmi
2022-08-23 16:56:04 +02:00
parent 2547ce824a
commit 3b8f4991e9
3 changed files with 16 additions and 13 deletions

View File

@ -168,14 +168,10 @@ class HomeActivity : AppCompatActivity(), SearchView.OnQueryTextListener, DIAwar
getElementsAccordingToTab()
CoroutineScope(Dispatchers.Main).launch {
repository.tryToCacheItemsAndGetNewOnes()
}
// TODO: items caching should be done in the background when starting the app, like background.kt does
// fetchedItems?.let {
// CoroutineScope(Dispatchers.Main).launch {
// insertDBItems(it)
// }
// }
}
private fun handleSwipeRefreshLayout() {

View File

@ -81,12 +81,7 @@ override fun doWork(): Result {
}
launch {
try {
val newItems = repository.getMaxItemsForBackground(ItemType.UNREAD)
handleNewItemsNotification(newItems, notifyNewItems, notificationManager)
repository.getMaxItemsForBackground(ItemType.ALL)
repository.getMaxItemsForBackground(ItemType.STARRED)
} catch (e: Throwable) {}
handleNewItemsNotification(repository.tryToCacheItemsAndGetNewOnes(), notifyNewItems, notificationManager)
}
}
}