mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-10-31 22:37:56 +01:00 
			
		
		
		
	Maybe avoid extensions list rendering crashes
This commit is contained in:
		| @@ -20,6 +20,7 @@ import kotlinx.coroutines.flow.StateFlow | ||||
| import kotlinx.coroutines.flow.asStateFlow | ||||
| import kotlinx.coroutines.flow.collectLatest | ||||
| import kotlinx.coroutines.flow.combine | ||||
| import kotlinx.coroutines.flow.debounce | ||||
| import kotlinx.coroutines.flow.launchIn | ||||
| import kotlinx.coroutines.flow.onEach | ||||
| import kotlinx.coroutines.flow.update | ||||
| @@ -114,10 +115,12 @@ class ExtensionsPresenter( | ||||
|                 } | ||||
|  | ||||
|                 items | ||||
|             }.collectLatest { | ||||
|                 state.isLoading = false | ||||
|                 state.items = it | ||||
|             } | ||||
|                 .debounce(500) // Avoid crashes due to LazyColumn rendering | ||||
|                 .collectLatest { | ||||
|                     state.isLoading = false | ||||
|                     state.items = it | ||||
|                 } | ||||
|         } | ||||
|  | ||||
|         presenterScope.launchIO { findAvailableExtensions() } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user