Skip to content

Commit

Permalink
Fix PKGS-1319 - Search glitch on module selection change (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
fscarponi authored Dec 8, 2023
1 parent 7c1ece2 commit d888fb8
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,13 @@ class PackageListViewModel(
else -> value
}
}
}.modifiedBy(selectedModulesFlow) { current: Map<PackageListItem.Header.Id.Remote, Search>, change ->
val changeIdentities = change.map { it.identity }
if (current.keys.any { it.moduleIdentity !in changeIdentities }) {
emptyMap()
} else {
current
}
}
.stateIn(viewModelScope, SharingStarted.Eagerly, emptyMap())

Expand Down

0 comments on commit d888fb8

Please sign in to comment.