feat(chats_screen): Real-time работа с lastMsg, галочки.

This commit is contained in:
Jganenok
2026-06-13 16:06:41 +07:00
parent efa50375e0
commit ebc22cd8bd
9 changed files with 564 additions and 93 deletions
+10
View File
@@ -135,6 +135,16 @@ class PresenceFetch {
static void invalidate(int id) => _cache.invalidate(id);
static void clear() => _cache.clear();
static void primeAll(Map<dynamic, dynamic> presence) {
final now = DateTime.now();
presence.forEach((key, value) {
if (value is! Map) return;
final id = key is int ? key : int.tryParse(key.toString());
if (id == null) return;
_cache.putValue(id, Map<String, dynamic>.from(value), at: now);
});
}
static Future<Map<String, dynamic>?> _fetch(int id) async {
final results = await _fetchBatch([id]);
return results[id];