Skip to content

Commit 0f8d217

Browse files
committed
[trello.com/c/jKqpxiCa/12] typo fix
1 parent 71dd074 commit 0f8d217

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Adamant/Modules/Chat/View/ChatViewController.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ final class ChatViewController: MessagesViewController {
219219

220220
override func scrollViewDidScroll(_ scrollView: UIScrollView) {
221221
super.scrollViewDidScroll(scrollView)
222-
if state.canReadByDidScroll {
222+
if state.isInitialMessagesWereUpdated {
223223
updateUnreadMessages()
224224
}
225225
updateIsScrollPositionNearlyTheBottom()
@@ -341,7 +341,7 @@ extension ChatViewController {
341341
viewModel.messagesUpdated
342342
.sink { [weak self] _ in
343343
self?.updateMessagesPosition()
344-
self?.state.canReadByDidScroll = true
344+
self?.state.isInitialMessagesWereUpdated = true
345345
self?.updateUnreadMessages()
346346
}
347347
.store(in: &subscriptions)
@@ -884,7 +884,7 @@ extension ChatViewController {
884884
}
885885
}
886886

887-
fileprivate func markMessageFromCurrentToBottomAsRead() {
887+
fileprivate func markMessagesFromCurrentToBottomAsRead() {
888888
guard let unreadIndexes = viewModel.unreadMesaggesIndexes, !unreadIndexes.isEmpty else { return }
889889

890890
let visibleSections = messagesCollectionView.indexPathsForVisibleItems.map { $0.section }
@@ -910,7 +910,7 @@ extension ChatViewController {
910910
guard let self else { return }
911911
if viewModel.shouldScrollToBottom {
912912
state.isScrollingToBottom = true
913-
markMessageFromCurrentToBottomAsRead()
913+
markMessagesFromCurrentToBottomAsRead()
914914
self.messagesCollectionView.scrollToBottom(animated: true)
915915
} else if let id = viewModel.unreadMessagesIds?.first {
916916
viewModel.animationType = MessageAnimationType.none

Adamant/Modules/Chat/View/ChatViewControllerState.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ struct ChatViewControllerState {
2020
var isAppActive = true
2121
var isScrollingToBottom = false
2222
var shouldScrollToNewMessages = true
23-
var canReadByDidScroll = false
23+
var isInitialMessagesWereUpdated = false
2424

2525
//calculation for animation, might use for something else in the future
2626
var isAnimationAllowed: Bool {

0 commit comments

Comments
 (0)