Skip to content

Commit

Permalink
Just cleaned a bit.
Browse files Browse the repository at this point in the history
  • Loading branch information
hojat72elect committed May 24, 2024
1 parent dea35d8 commit f099de8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ fun PackageManager.getNativeAppPackageForUrl(url: String): String? {
it.activityInfo.packageName
}

return resolvedSpecializedApps.subtract(resolvedGenericApps).firstOrNull()
return resolvedSpecializedApps.subtract(resolvedGenericApps.toSet()).firstOrNull()
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import ca.hojat.gamehub.core.extensions.onError
import ca.hojat.gamehub.core.extensions.resultOrError
import ca.hojat.gamehub.core.mappers.ErrorMapper
import ca.hojat.gamehub.core.providers.StringProvider
import ca.hojat.gamehub.feature_category.di.CategoryKey
import ca.hojat.gamehub.feature_category.widgets.CategoryItemModelMapper
import ca.hojat.gamehub.feature_category.widgets.CategoryUiModel
import ca.hojat.gamehub.feature_category.widgets.CategoryUiState
Expand Down Expand Up @@ -55,8 +54,8 @@ internal class CategoryViewModel @Inject constructor(
private var observeUseCaseParams = ObserveUseCaseParams()
private var refreshUseCaseParams = RefreshUseCaseParams()

private val categoryType: CategoryType
private val categoryKeyType: CategoryKey.Type
private val categoryType = CategoryType.valueOf(checkNotNull(savedStateHandle.get<String>(PARAM_CATEGORY)))
private val categoryKeyType = categoryType.toKeyType()

private var observingJob: Job? = null
private var refreshingJob: Job? = null
Expand All @@ -69,9 +68,6 @@ internal class CategoryViewModel @Inject constructor(
val uiState: StateFlow<CategoryUiState> = _uiState.asStateFlow()

init {
categoryType =
CategoryType.valueOf(checkNotNull(savedStateHandle.get<String>(PARAM_CATEGORY)))
categoryKeyType = categoryType.toKeyType()

_uiState.update {
it.copy(title = stringProvider.getString(categoryType.titleId))
Expand Down Expand Up @@ -184,7 +180,7 @@ internal class CategoryViewModel @Inject constructor(

private suspend fun observeNewBatch() {
observeUseCaseParams = observeUseCaseParams.copy(
observeUseCaseParams.pagination.nextLimit()
pagination = observeUseCaseParams.pagination.nextLimit()
)

observingJob?.cancelAndJoin()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ internal class LikesViewModel @Inject constructor(
if (!hasMoreGamesToLoad) return

observeUseCaseParams = observeUseCaseParams.copy(
observeUseCaseParams.pagination.nextLimit()
pagination = observeUseCaseParams.pagination.nextLimit()
)

viewModelScope.launch {
Expand Down

0 comments on commit f099de8

Please sign in to comment.