mirror of
				https://github.com/commons-app/apps-android-commons.git
				synced 2025-10-30 22:34:02 +01:00 
			
		
		
		
	#3733 On first view of DepictionUpload suggestions don't show - remove zip which was only taking 1 value from the processor (#3737)
This commit is contained in:
		
							parent
							
								
									057d11a0e0
								
							
						
					
					
						commit
						affcd8a6d7
					
				
					 2 changed files with 4 additions and 9 deletions
				
			
		|  | @ -9,7 +9,6 @@ import fr.free.nrw.commons.wikidata.WikidataDisambiguationItems | |||
| import io.reactivex.Flowable | ||||
| import io.reactivex.Scheduler | ||||
| import io.reactivex.disposables.CompositeDisposable | ||||
| import io.reactivex.functions.BiFunction | ||||
| import io.reactivex.processors.PublishProcessor | ||||
| import timber.log.Timber | ||||
| import java.lang.reflect.Proxy | ||||
|  | @ -59,12 +58,8 @@ class DepictsPresenter @Inject constructor( | |||
|         ) | ||||
|     } | ||||
| 
 | ||||
|     private fun searchResultsWithTerm(it: String): Flowable<Pair<List<DepictedItem>, String>> { | ||||
|         return Flowable.zip( | ||||
|             searchResults(it), | ||||
|             Flowable.just(it), | ||||
|             BiFunction { results: List<DepictedItem>, term: String -> Pair(results, term) } | ||||
|         ) | ||||
|     private fun searchResultsWithTerm(term: String): Flowable<Pair<List<DepictedItem>, String>> { | ||||
|         return searchResults(term).map { Pair(it, term) } | ||||
|     } | ||||
| 
 | ||||
|     private fun searchResults(it: String): Flowable<List<DepictedItem>> { | ||||
|  |  | |||
|  | @ -13,7 +13,7 @@ import javax.inject.Singleton | |||
| @Singleton | ||||
| class DepictModel @Inject constructor(private val depictsClient: DepictsClient) { | ||||
| 
 | ||||
|     var nearbyPlaces: BehaviorProcessor<List<Place>> = BehaviorProcessor.createDefault(emptyList()) | ||||
|     val nearbyPlaces: BehaviorProcessor<List<Place>> = BehaviorProcessor.createDefault(emptyList()) | ||||
| 
 | ||||
| 
 | ||||
|     companion object { | ||||
|  | @ -45,7 +45,7 @@ class DepictModel @Inject constructor(private val depictsClient: DepictsClient) | |||
|     } | ||||
| 
 | ||||
|     fun cleanUp() { | ||||
|         nearbyPlaces = BehaviorProcessor.createDefault(emptyList()) | ||||
|         nearbyPlaces.offer(emptyList()) | ||||
|     } | ||||
| 
 | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Seán Mac Gillicuddy
						Seán Mac Gillicuddy