File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
Adamant/Services/DataProviders Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -188,14 +188,18 @@ extension AdamantChatsProvider {
188
188
userInfo: [ AdamantUserInfoKey . ChatProvider. lastMessageHeight: h] )
189
189
}
190
190
191
- self ? . readedLastHeight = self ? . receivedLastHeight
191
+ if let h = self ? . receivedLastHeight {
192
+ self ? . readedLastHeight = h
193
+ } else {
194
+ self ? . readedLastHeight = 0
195
+ }
192
196
193
197
if let store = self ? . securedStore {
194
198
if let h = self ? . receivedLastHeight {
195
199
store. set ( String ( h) , for: StoreKey . chatProvider. receivedLastHeight)
196
200
}
197
201
198
- if let h = self ? . readedLastHeight {
202
+ if let h = self ? . readedLastHeight, h > 0 {
199
203
store. set ( String ( h) , for: StoreKey . chatProvider. readedLastHeight)
200
204
}
201
205
}
@@ -638,12 +642,6 @@ extension AdamantChatsProvider {
638
642
chatroom. hasUnreadMessages = true
639
643
trs. forEach ( { $0. isUnread = true } )
640
644
}
641
- } else {
642
- let msgs = Dictionary ( grouping: newChatTransactions, by: ( { ( t: ChatTransaction ) -> Chatroom in t. chatroom!} ) )
643
- for (chatroom, trs) in msgs {
644
- chatroom. hasUnreadMessages = true
645
- trs. forEach ( { $0. isUnread = true } )
646
- }
647
645
}
648
646
649
647
You can’t perform that action at this time.
0 commit comments