fix: sort apps by name before saving

This commit is contained in:
Alberto Ponces 2022-09-03 15:28:22 +01:00
parent d8c4997179
commit fee8171ec0

View File

@ -61,6 +61,9 @@ class ManagerAPI {
} }
Future<void> setPatchedApps(List<PatchedApplication> patchedApps) async { Future<void> setPatchedApps(List<PatchedApplication> patchedApps) async {
if (patchedApps.length > 1) {
patchedApps.sort((a, b) => a.name.compareTo(b.name));
}
await _prefs.setStringList('patchedApps', await _prefs.setStringList('patchedApps',
patchedApps.map((a) => json.encode(a.toJson())).toList()); patchedApps.map((a) => json.encode(a.toJson())).toList());
} }