mirror of
				https://github.com/commons-app/apps-android-commons.git
				synced 2025-10-31 14:53:59 +01:00 
			
		
		
		
	Merge branch 'main' into issue5583
This commit is contained in:
		
						commit
						2d59c3b023
					
				
					 1 changed files with 5 additions and 16 deletions
				
			
		|  | @ -16,12 +16,9 @@ import io.reactivex.android.schedulers.AndroidSchedulers | |||
| import io.reactivex.disposables.CompositeDisposable | ||||
| import io.reactivex.processors.PublishProcessor | ||||
| import io.reactivex.schedulers.Schedulers | ||||
| import kotlinx.coroutines.CoroutineScope | ||||
| import kotlinx.coroutines.Dispatchers | ||||
| import kotlinx.coroutines.launch | ||||
| import kotlinx.coroutines.runBlocking | ||||
| import timber.log.Timber | ||||
| import java.lang.reflect.Proxy | ||||
| import java.util.* | ||||
| import javax.inject.Inject | ||||
| import javax.inject.Named | ||||
| import javax.inject.Singleton | ||||
|  | @ -88,7 +85,7 @@ class DepictsPresenter @Inject constructor( | |||
|         var recentDepictedItemList: MutableList<DepictedItem> = ArrayList(); | ||||
|         //show recentDepictedItemList when queryString is empty | ||||
|         if (querystring.isEmpty()) { | ||||
|             recentDepictedItemList = getRecentDepictedItems(); | ||||
|             recentDepictedItemList = getRecentDepictedItems().toMutableList() | ||||
|         } | ||||
| 
 | ||||
|         if (media == null) { | ||||
|  | @ -268,17 +265,9 @@ class DepictsPresenter @Inject constructor( | |||
|     /** | ||||
|      * Get the depicts from DepictsRoomdataBase | ||||
|      */ | ||||
|     fun getRecentDepictedItems(): MutableList<DepictedItem> { | ||||
|         val depictedItemList: MutableList<DepictedItem> = ArrayList() | ||||
|         CoroutineScope(Dispatchers.IO).launch { | ||||
|     private fun getRecentDepictedItems(): List<DepictedItem> = runBlocking { | ||||
|         val depictsList = depictsDao.depictsList().await() | ||||
| 
 | ||||
|             for (i in depictsList.indices) { | ||||
|                 val depictedItem = depictsList[i].item | ||||
|                 depictedItemList.add(depictedItem) | ||||
|             } | ||||
|         } | ||||
|         return depictedItemList | ||||
|         return@runBlocking depictsList.map { it.item } | ||||
|     } | ||||
| } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Nicolas Raoul
						Nicolas Raoul