fix(patch-item): hide universal patches if not enabled (#1087)

This commit is contained in:
aAbed
2023-08-05 19:04:36 +05:45
committed by GitHub
parent 2f471b3de4
commit 5346f6e1bf
2 changed files with 21 additions and 10 deletions

View File

@ -81,7 +81,7 @@ class PatchesSelectorViewModel extends BaseViewModel {
}
List<Patch> getQueriedPatches(String query) {
return patches
final List<Patch> patch = patches
.where(
(patch) =>
query.isEmpty ||
@ -90,6 +90,13 @@ class PatchesSelectorViewModel extends BaseViewModel {
patch.getSimpleName().toLowerCase().contains(query.toLowerCase()),
)
.toList();
if (_managerAPI.areUniversalPatchesEnabled()) {
return patch;
} else {
return patch
.where((patch) => patch.compatiblePackages.isNotEmpty)
.toList();
}
}
String getAppVersion() {