mirror of
https://github.com/revanced/revanced-manager.git
synced 2025-05-01 14:34:24 +02:00
fix(patch-item): hide universal patches if not enabled (#1087)
This commit is contained in:
parent
2f471b3de4
commit
5346f6e1bf
@ -103,7 +103,6 @@ class PatcherAPI {
|
|||||||
}
|
}
|
||||||
|
|
||||||
List<Patch> getFilteredPatches(String packageName) {
|
List<Patch> getFilteredPatches(String packageName) {
|
||||||
if (!filteredPatches.keys.contains(packageName)) {
|
|
||||||
final List<Patch> patches = _patches
|
final List<Patch> patches = _patches
|
||||||
.where(
|
.where(
|
||||||
(patch) =>
|
(patch) =>
|
||||||
@ -113,6 +112,11 @@ class PatcherAPI {
|
|||||||
.any((pack) => pack.name == packageName),
|
.any((pack) => pack.name == packageName),
|
||||||
)
|
)
|
||||||
.toList();
|
.toList();
|
||||||
|
if (!_managerAPI.areUniversalPatchesEnabled()) {
|
||||||
|
filteredPatches[packageName] = patches
|
||||||
|
.where((patch) => patch.compatiblePackages.isNotEmpty)
|
||||||
|
.toList();
|
||||||
|
} else {
|
||||||
filteredPatches[packageName] = patches;
|
filteredPatches[packageName] = patches;
|
||||||
}
|
}
|
||||||
return filteredPatches[packageName];
|
return filteredPatches[packageName];
|
||||||
|
@ -81,7 +81,7 @@ class PatchesSelectorViewModel extends BaseViewModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
List<Patch> getQueriedPatches(String query) {
|
List<Patch> getQueriedPatches(String query) {
|
||||||
return patches
|
final List<Patch> patch = patches
|
||||||
.where(
|
.where(
|
||||||
(patch) =>
|
(patch) =>
|
||||||
query.isEmpty ||
|
query.isEmpty ||
|
||||||
@ -90,6 +90,13 @@ class PatchesSelectorViewModel extends BaseViewModel {
|
|||||||
patch.getSimpleName().toLowerCase().contains(query.toLowerCase()),
|
patch.getSimpleName().toLowerCase().contains(query.toLowerCase()),
|
||||||
)
|
)
|
||||||
.toList();
|
.toList();
|
||||||
|
if (_managerAPI.areUniversalPatchesEnabled()) {
|
||||||
|
return patch;
|
||||||
|
} else {
|
||||||
|
return patch
|
||||||
|
.where((patch) => patch.compatiblePackages.isNotEmpty)
|
||||||
|
.toList();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
String getAppVersion() {
|
String getAppVersion() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user