From fee8171ec07cd35bd314c1632bbb05fc86a4a410 Mon Sep 17 00:00:00 2001 From: Alberto Ponces Date: Sat, 3 Sep 2022 15:28:22 +0100 Subject: [PATCH] fix: sort apps by name before saving --- lib/services/manager_api.dart | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/services/manager_api.dart b/lib/services/manager_api.dart index e0af730e..08b3f251 100644 --- a/lib/services/manager_api.dart +++ b/lib/services/manager_api.dart @@ -61,6 +61,9 @@ class ManagerAPI { } Future setPatchedApps(List patchedApps) async { + if (patchedApps.length > 1) { + patchedApps.sort((a, b) => a.name.compareTo(b.name)); + } await _prefs.setStringList('patchedApps', patchedApps.map((a) => json.encode(a.toJson())).toList()); }