mirror of
				https://github.com/commons-app/apps-android-commons.git
				synced 2025-10-31 06:43:56 +01:00 
			
		
		
		
	Fixes 4745 : Add bookmarked items to suggested depictions (#4746)
* Dialog can't be dismissed * Dialog can't be dismissed * Appended bookmarked items in searching * Test fixed * Resolve conflicts * Resolve conflicts
This commit is contained in:
		
							parent
							
								
									9525409b9b
								
							
						
					
					
						commit
						fec27ed914
					
				
					 1 changed files with 10 additions and 2 deletions
				
			
		|  | @ -3,6 +3,7 @@ package fr.free.nrw.commons.upload.depicts | |||
| import android.annotation.SuppressLint | ||||
| import androidx.lifecycle.LiveData | ||||
| import androidx.lifecycle.MutableLiveData | ||||
| import fr.free.nrw.commons.bookmarks.items.BookmarkItemsController | ||||
| import fr.free.nrw.commons.Media | ||||
| import fr.free.nrw.commons.di.CommonsApplicationModule | ||||
| import fr.free.nrw.commons.repository.UploadRepository | ||||
|  | @ -42,6 +43,13 @@ class DepictsPresenter @Inject constructor( | |||
|     private var media: Media? = null | ||||
|     @Inject | ||||
|     lateinit var depictsDao: DepictsDao | ||||
| 
 | ||||
|     /** | ||||
|      * Helps to get all bookmarked items | ||||
|      */ | ||||
|     @Inject | ||||
|     lateinit var controller: BookmarkItemsController | ||||
| 
 | ||||
|     @Inject | ||||
|     lateinit var depictsHelper: DepictEditHelper | ||||
| 
 | ||||
|  | @ -82,7 +90,7 @@ class DepictsPresenter @Inject constructor( | |||
|         if (media == null) { | ||||
|             return repository.searchAllEntities(querystring) | ||||
|                 .subscribeOn(ioScheduler) | ||||
|                 .map { repository.selectedDepictions + it + recentDepictedItemList } | ||||
|                 .map { repository.selectedDepictions + it + recentDepictedItemList + controller.loadFavoritesItems() } | ||||
|                 .map { it.filterNot { item -> WikidataDisambiguationItems.isDisambiguationItem(item.instanceOfs) } } | ||||
|                 .map { it.distinctBy(DepictedItem::id) } | ||||
| 
 | ||||
|  | @ -99,7 +107,7 @@ class DepictsPresenter @Inject constructor( | |||
|                 } | ||||
|             ) | ||||
|                 .subscribeOn(ioScheduler) | ||||
|                 .map { repository.selectedDepictions + it + recentDepictedItemList } | ||||
|                 .map { repository.selectedDepictions + it + recentDepictedItemList + controller.loadFavoritesItems() } | ||||
|                 .map { it.filterNot { item -> WikidataDisambiguationItems.isDisambiguationItem(item.instanceOfs) } } | ||||
|                 .map { it.distinctBy(DepictedItem::id) } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Ayan Sarkar
						Ayan Sarkar