Fix: Database access on Main crashes

This commit is contained in:
machiav3lli
2022-01-13 23:52:30 +01:00
parent 27a54c1b08
commit e559f19529
2 changed files with 5 additions and 5 deletions

View File

@ -435,7 +435,7 @@ class SyncService : ConnectionService<SyncService.Binder>() {
* @see SyncService.displayUpdatesNotification
*/
private fun runAutoUpdate(productItems: List<ProductItem>) {
if (Preferences[Preferences.Key.InstallAfterSync]) {
if (Preferences[Preferences.Key.InstallAfterSync]) GlobalScope.launch {
// run startUpdate on every item
productItems.map { productItem ->
Pair(