fix: initializing last synced data
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
## Upcomming
|
||||
|
||||
🐞 Fixed
|
||||
- Fixed initializing last synced date.
|
||||
|
||||
## 5.1.0
|
||||
|
||||
✅ Added
|
||||
|
||||
@@ -453,6 +453,15 @@ class StreamChatClient {
|
||||
if (persistenceEnabled) {
|
||||
await sync(cids: cids, lastSyncAt: _lastSyncedAt);
|
||||
}
|
||||
} else {
|
||||
// channels are empty, assuming it's a fresh start
|
||||
// and making sure `lastSyncAt` is initialized
|
||||
if (persistenceEnabled) {
|
||||
final lastSyncAt = await _chatPersistenceClient?.getLastSyncAt();
|
||||
if (lastSyncAt == null) {
|
||||
await _chatPersistenceClient?.updateLastSyncAt(DateTime.now());
|
||||
}
|
||||
}
|
||||
}
|
||||
handleEvent(Event(
|
||||
type: EventType.connectionRecovered,
|
||||
|
||||
Reference in New Issue
Block a user