From 32eb4e0d52b52afa0e9ecb5109ab994f35047b62 Mon Sep 17 00:00:00 2001 From: JulianAlcala Date: Sun, 26 Apr 2026 05:13:05 +0200 Subject: [PATCH] fix(call-history): sort calls by most recent first --- .../presentation/providers/call_history_provider.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/legacy/modules/device_management/lib/src/features/call_history/presentation/providers/call_history_provider.dart b/modules/legacy/modules/device_management/lib/src/features/call_history/presentation/providers/call_history_provider.dart index f4207fc9..e6d29dc4 100644 --- a/modules/legacy/modules/device_management/lib/src/features/call_history/presentation/providers/call_history_provider.dart +++ b/modules/legacy/modules/device_management/lib/src/features/call_history/presentation/providers/call_history_provider.dart @@ -9,7 +9,9 @@ Future> callHistory( Ref ref, String deviceIdentificator, ) async { - return ref + final calls = await ref .read(callHistoryDatasourceProvider) .getCallHistory(deviceIdentificator: deviceIdentificator); + calls.sort((a, b) => b.occurredAt.compareTo(a.occurredAt)); + return calls; }